summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nvfx_miptree.c
diff options
context:
space:
mode:
authorVinson Lee <vlee@vmware.com>2010-08-21 14:29:50 -0700
committerVinson Lee <vlee@vmware.com>2010-08-21 14:29:50 -0700
commit489c787b80064b590016eecf2b8157760b0bc8a2 (patch)
treeda4110dfcb3c4149563cba8c5d8e6f8f94f2e122 /src/gallium/drivers/nvfx/nvfx_miptree.c
parent11d27871a79fb7ffcf0e139a8c04d90991969023 (diff)
nvfx: Fix SCons build.
Move declarations before code. Fix void pointer arithmetic.
Diffstat (limited to 'src/gallium/drivers/nvfx/nvfx_miptree.c')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_miptree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_miptree.c b/src/gallium/drivers/nvfx/nvfx_miptree.c
index 559e832109..0532b43ef0 100644
--- a/src/gallium/drivers/nvfx/nvfx_miptree.c
+++ b/src/gallium/drivers/nvfx/nvfx_miptree.c
@@ -155,9 +155,10 @@ struct pipe_resource *
nvfx_miptree_create(struct pipe_screen *pscreen, const struct pipe_resource *pt)
{
struct nvfx_miptree* mt = nvfx_miptree_create_skeleton(pscreen, pt);
+ unsigned size;
nvfx_miptree_choose_format(mt);
- unsigned size = nvfx_miptree_layout(mt);
+ size = nvfx_miptree_layout(mt);
mt->base.bo = nouveau_screen_bo_new(pscreen, 256, pt->usage, pt->bind, size);
@@ -173,6 +174,7 @@ struct pipe_resource *
nvfx_miptree_from_handle(struct pipe_screen *pscreen, const struct pipe_resource *template, struct winsys_handle *whandle)
{
struct nvfx_miptree* mt = nvfx_miptree_create_skeleton(pscreen, template);
+ unsigned stride;
if(whandle->stride) {
mt->linear_pitch = whandle->stride;
mt->base.base.flags |= NVFX_RESOURCE_FLAG_LINEAR;
@@ -181,7 +183,6 @@ nvfx_miptree_from_handle(struct pipe_screen *pscreen, const struct pipe_resource
nvfx_miptree_layout(mt);
- unsigned stride;
mt->base.bo = nouveau_screen_bo_from_handle(pscreen, whandle, &stride);
if (mt->base.bo == NULL) {
FREE(mt);