summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/nvfx/nv04_surface_2d.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/nvfx/nv04_surface_2d.c')
-rw-r--r--src/gallium/drivers/nvfx/nv04_surface_2d.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/gallium/drivers/nvfx/nv04_surface_2d.c b/src/gallium/drivers/nvfx/nv04_surface_2d.c
index a1507bbb3c..4ed574227d 100644
--- a/src/gallium/drivers/nvfx/nv04_surface_2d.c
+++ b/src/gallium/drivers/nvfx/nv04_surface_2d.c
@@ -497,6 +497,9 @@ struct nv04_surface*
nv04_surface_wrap_for_render(struct pipe_screen *pscreen,
struct nv04_surface_2d* eng2d, struct nv04_surface* ns)
{
+ struct pipe_resource templ;
+ struct pipe_resource* temp_tex;
+ struct nv04_surface* temp_ns;
int temp_flags;
temp_flags = (ns->base.usage |
@@ -506,7 +509,6 @@ nv04_surface_wrap_for_render(struct pipe_screen *pscreen,
ns->base.usage = (PIPE_BIND_BLIT_SOURCE |
PIPE_BIND_BLIT_DESTINATION);
- struct pipe_resource templ;
memset(&templ, 0, sizeof(templ));
templ.format = ns->base.texture->format;
templ.target = PIPE_TEXTURE_2D;
@@ -520,8 +522,8 @@ nv04_surface_wrap_for_render(struct pipe_screen *pscreen,
templ.bind = ns->base.texture->bind | PIPE_BIND_RENDER_TARGET;
- struct pipe_resource* temp_tex = pscreen->resource_create(pscreen, &templ);
- struct nv04_surface* temp_ns = (struct nv04_surface*)pscreen->get_tex_surface(pscreen, temp_tex, 0, 0, 0, temp_flags);
+ temp_tex = pscreen->resource_create(pscreen, &templ);
+ temp_ns = (struct nv04_surface*)pscreen->get_tex_surface(pscreen, temp_tex, 0, 0, 0, temp_flags);
temp_ns->backing = ns;
if(ns->base.usage & PIPE_BIND_BLIT_SOURCE)