diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2013-11-12 20:36:40 +0000 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2013-11-12 20:36:40 +0000 |
commit | 1d81454ea351dbbf7d9475918e2833424efa2b85 (patch) | |
tree | 1a73dd277707f348b2ea7b6f3a095b3bc94b1677 /src | |
parent | d677baccd0f746ddf1296d194bd3eb42e60459d5 (diff) |
fb demos: do not use rt_resource->last_ctx as it never gets set
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/fb/alpha_blend.c | 2 | ||||
-rw-r--r-- | src/fb/cube_companion.c | 2 | ||||
-rw-r--r-- | src/fb/cubemap_sphere.c | 2 | ||||
-rw-r--r-- | src/fb/displacement.c | 2 | ||||
-rw-r--r-- | src/fb/etna_gears.c | 2 | ||||
-rw-r--r-- | src/fb/mip_cube.c | 2 | ||||
-rw-r--r-- | src/fb/particle_system.c | 2 | ||||
-rw-r--r-- | src/fb/ps_sandbox.c | 2 | ||||
-rw-r--r-- | src/fb/rotate_cube.c | 2 | ||||
-rw-r--r-- | src/fb/stencil_test.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/alpha_blend.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/cube_companion.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/cubemap_sphere.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/displacement.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/etna_gears.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/mip_cube.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/particle_system.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/rotate_cube.c | 2 | ||||
-rw-r--r-- | src/fb_rawshader/stencil_test.c | 2 | ||||
-rw-r--r-- | src/lib/fbdemos.c | 6 | ||||
-rw-r--r-- | src/lib/fbdemos.h | 2 |
21 files changed, 23 insertions, 23 deletions
diff --git a/src/fb/alpha_blend.c b/src/fb/alpha_blend.c index 3d0a553..ba5449c 100644 --- a/src/fb/alpha_blend.c +++ b/src/fb/alpha_blend.c @@ -112,7 +112,7 @@ int main(int argc, char **argv) struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* interleave vertex data */ struct pipe_transfer *transfer = 0; diff --git a/src/fb/cube_companion.c b/src/fb/cube_companion.c index 8e565ed..144ac92 100644 --- a/src/fb/cube_companion.c +++ b/src/fb/cube_companion.c @@ -134,7 +134,7 @@ int main(int argc, char **argv) struct pipe_resource *z_resource = fbdemo_create_2d(fbs->screen, PIPE_BIND_RENDER_TARGET, PIPE_FORMAT_Z16_UNORM, width, height, 0); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* geometry */ struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); diff --git a/src/fb/cubemap_sphere.c b/src/fb/cubemap_sphere.c index d6895fc..1970dd6 100644 --- a/src/fb/cubemap_sphere.c +++ b/src/fb/cubemap_sphere.c @@ -130,7 +130,7 @@ int main(int argc, char **argv) struct pipe_resource *idx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* Phew, now we got all the memory we need. * Write interleaved attribute vertex stream. diff --git a/src/fb/displacement.c b/src/fb/displacement.c index b01888e..189bab2 100644 --- a/src/fb/displacement.c +++ b/src/fb/displacement.c @@ -147,7 +147,7 @@ int main(int argc, char **argv) struct pipe_resource *idx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* Phew, now we got all the memory we need. * Write interleaved attribute vertex stream. diff --git a/src/fb/etna_gears.c b/src/fb/etna_gears.c index bc36215..9c38dd7 100644 --- a/src/fb/etna_gears.c +++ b/src/fb/etna_gears.c @@ -521,7 +521,7 @@ main(int argc, char *argv[]) }); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* compile gallium3d states */ void *blend = pipe->create_blend_state(pipe, &(struct pipe_blend_state) { diff --git a/src/fb/mip_cube.c b/src/fb/mip_cube.c index 5f262e1..befe33a 100644 --- a/src/fb/mip_cube.c +++ b/src/fb/mip_cube.c @@ -273,7 +273,7 @@ int main(int argc, char **argv) struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* Phew, now we got all the memory we need. * Write interleaved attribute vertex stream. diff --git a/src/fb/particle_system.c b/src/fb/particle_system.c index 18bc4b2..e866709 100644 --- a/src/fb/particle_system.c +++ b/src/fb/particle_system.c @@ -133,7 +133,7 @@ int main(int argc, char **argv) struct pipe_resource *z_resource = fbdemo_create_2d(fbs->screen, PIPE_BIND_RENDER_TARGET, PIPE_FORMAT_Z16_UNORM, width, height, 0); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* surfaces */ struct pipe_surface *cbuf = pipe->create_surface(pipe, rt_resource, &(struct pipe_surface){ diff --git a/src/fb/ps_sandbox.c b/src/fb/ps_sandbox.c index f0d7739..0fcc315 100644 --- a/src/fb/ps_sandbox.c +++ b/src/fb/ps_sandbox.c @@ -147,7 +147,7 @@ int main(int argc, char **argv) struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, sizeof(vVertices)); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* vertex / index buffer setup */ struct pipe_transfer *vtx_transfer = 0; diff --git a/src/fb/rotate_cube.c b/src/fb/rotate_cube.c index d61e70f..3c7336e 100644 --- a/src/fb/rotate_cube.c +++ b/src/fb/rotate_cube.c @@ -202,7 +202,7 @@ int main(int argc, char **argv) struct pipe_resource *z_resource = fbdemo_create_2d(fbs->screen, PIPE_BIND_RENDER_TARGET, PIPE_FORMAT_Z16_UNORM, width, height, 0); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* geometry */ struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); diff --git a/src/fb/stencil_test.c b/src/fb/stencil_test.c index eea8463..149bdf4 100644 --- a/src/fb/stencil_test.c +++ b/src/fb/stencil_test.c @@ -127,7 +127,7 @@ int main(int argc, char **argv) struct pipe_resource *idx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* vertex / index buffer setup */ struct pipe_transfer *vtx_transfer = 0; diff --git a/src/fb_rawshader/alpha_blend.c b/src/fb_rawshader/alpha_blend.c index 87f763f..45012dc 100644 --- a/src/fb_rawshader/alpha_blend.c +++ b/src/fb_rawshader/alpha_blend.c @@ -134,7 +134,7 @@ int main(int argc, char **argv) struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* interleave vertex data */ struct pipe_transfer *transfer = 0; diff --git a/src/fb_rawshader/cube_companion.c b/src/fb_rawshader/cube_companion.c index dbb3f3e..922e60f 100644 --- a/src/fb_rawshader/cube_companion.c +++ b/src/fb_rawshader/cube_companion.c @@ -146,7 +146,7 @@ int main(int argc, char **argv) struct pipe_resource *z_resource = fbdemo_create_2d(fbs->screen, PIPE_BIND_RENDER_TARGET, PIPE_FORMAT_Z16_UNORM, width, height, 0); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* geometry */ struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); diff --git a/src/fb_rawshader/cubemap_sphere.c b/src/fb_rawshader/cubemap_sphere.c index 9a199c5..792f750 100644 --- a/src/fb_rawshader/cubemap_sphere.c +++ b/src/fb_rawshader/cubemap_sphere.c @@ -146,7 +146,7 @@ int main(int argc, char **argv) struct pipe_resource *idx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* Phew, now we got all the memory we need. * Write interleaved attribute vertex stream. diff --git a/src/fb_rawshader/displacement.c b/src/fb_rawshader/displacement.c index 64d3c6f..66761bd 100644 --- a/src/fb_rawshader/displacement.c +++ b/src/fb_rawshader/displacement.c @@ -165,7 +165,7 @@ int main(int argc, char **argv) struct pipe_resource *idx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* Phew, now we got all the memory we need. * Write interleaved attribute vertex stream. diff --git a/src/fb_rawshader/etna_gears.c b/src/fb_rawshader/etna_gears.c index dfc0fe0..58505cb 100644 --- a/src/fb_rawshader/etna_gears.c +++ b/src/fb_rawshader/etna_gears.c @@ -528,7 +528,7 @@ main(int argc, char *argv[]) }); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* compile gallium3d states */ void *blend = pipe->create_blend_state(pipe, &(struct pipe_blend_state) { diff --git a/src/fb_rawshader/mip_cube.c b/src/fb_rawshader/mip_cube.c index 2334de8..7e9c456 100644 --- a/src/fb_rawshader/mip_cube.c +++ b/src/fb_rawshader/mip_cube.c @@ -263,7 +263,7 @@ int main(int argc, char **argv) struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* Phew, now we got all the memory we need. * Write interleaved attribute vertex stream. diff --git a/src/fb_rawshader/particle_system.c b/src/fb_rawshader/particle_system.c index 2f4f9ee..050bf06 100644 --- a/src/fb_rawshader/particle_system.c +++ b/src/fb_rawshader/particle_system.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) struct pipe_resource *z_resource = fbdemo_create_2d(fbs->screen, PIPE_BIND_RENDER_TARGET, PIPE_FORMAT_Z16_UNORM, width, height, 0); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* surfaces */ struct pipe_surface *cbuf = pipe->create_surface(pipe, rt_resource, &(struct pipe_surface){ diff --git a/src/fb_rawshader/rotate_cube.c b/src/fb_rawshader/rotate_cube.c index 0c6a7c3..bc8a43e 100644 --- a/src/fb_rawshader/rotate_cube.c +++ b/src/fb_rawshader/rotate_cube.c @@ -220,7 +220,7 @@ int main(int argc, char **argv) struct pipe_resource *z_resource = fbdemo_create_2d(fbs->screen, PIPE_BIND_RENDER_TARGET, PIPE_FORMAT_Z16_UNORM, width, height, 0); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* geometry */ struct pipe_resource *vtx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_VERTEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); diff --git a/src/fb_rawshader/stencil_test.c b/src/fb_rawshader/stencil_test.c index 1d9280f..e82fa80 100644 --- a/src/fb_rawshader/stencil_test.c +++ b/src/fb_rawshader/stencil_test.c @@ -152,7 +152,7 @@ int main(int argc, char **argv) struct pipe_resource *idx_resource = pipe_buffer_create(fbs->screen, PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_IMMUTABLE, VERTEX_BUFFER_SIZE); /* bind render target to framebuffer */ - etna_fb_bind_resource(&fbs->fb, rt_resource); + etna_fb_bind_resource(fbs, rt_resource); /* vertex / index buffer setup */ struct pipe_transfer *vtx_transfer = 0; diff --git a/src/lib/fbdemos.c b/src/lib/fbdemos.c index 2b72d07..cc1dff5 100644 --- a/src/lib/fbdemos.c +++ b/src/lib/fbdemos.c @@ -279,10 +279,10 @@ int fb_close(struct fb_info *fb) } -int etna_fb_bind_resource(struct fb_info *fb, struct pipe_resource *rt_resource_) +int etna_fb_bind_resource(struct fbdemos_scaffold *fbs, struct pipe_resource *rt_resource_) { + struct fb_info *fb = &fbs->fb; struct etna_resource *rt_resource = etna_resource(rt_resource_); - struct etna_pipe_context *ectx = rt_resource->last_ctx; fb->resource = rt_resource; assert(rt_resource->base.width0 <= fb->fb_var.xres && rt_resource->base.height0 <= fb->fb_var.yres); int msaa_xscale=1, msaa_yscale=1; @@ -291,7 +291,7 @@ int etna_fb_bind_resource(struct fb_info *fb, struct pipe_resource *rt_resource_ for(int bi=0; bi<ETNA_FB_MAX_BUFFERS; ++bi) { - etna_compile_rs_state(ectx->ctx, &fb->copy_to_screen[bi], &(struct rs_state){ + etna_compile_rs_state(fbs->ctx, &fb->copy_to_screen[bi], &(struct rs_state){ .source_format = translate_rt_format(rt_resource->base.format, false), .source_tiling = rt_resource->layout, .source_addr = etna_bo_gpu_address(rt_resource->bo) + rt_resource->levels[0].offset, diff --git a/src/lib/fbdemos.h b/src/lib/fbdemos.h index 9079fea..a0d7612 100644 --- a/src/lib/fbdemos.h +++ b/src/lib/fbdemos.h @@ -88,7 +88,7 @@ int fb_set_buffer(struct fb_info *fb, int buffer); int fb_close(struct fb_info *fb); /* Bind framebuffer to render target resource */ -int etna_fb_bind_resource(struct fb_info *fb, struct pipe_resource *rt_resource); +int etna_fb_bind_resource(struct fbdemos_scaffold *fbs, struct pipe_resource *rt_resource); /* Copy framebuffer from bound render target resource */ int etna_fb_copy_buffer(struct fb_info *fb, struct etna_ctx *ctx, int buffer); |