summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-13 03:14:51 -0800
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-13 03:14:51 -0800
commit24ab6f51f93c2873c048f4eaa261c44d01440d67 (patch)
treefb1e2ce10a9f46386b3ffc047ce0a88a09ff7e86
parent610025b85ba0465595a2a467cf66a419047d142c (diff)
parent1d81454ea351dbbf7d9475918e2833424efa2b85 (diff)
Merge pull request #20 from austriancoder/master
small steps to get gc2000 up and running
-rw-r--r--src/etnaviv/etna_rs.c66
-rw-r--r--src/fb/alpha_blend.c2
-rw-r--r--src/fb/cube_companion.c2
-rw-r--r--src/fb/cubemap_sphere.c2
-rw-r--r--src/fb/displacement.c2
-rw-r--r--src/fb/etna_gears.c2
-rw-r--r--src/fb/mip_cube.c2
-rw-r--r--src/fb/particle_system.c2
-rw-r--r--src/fb/ps_sandbox.c2
-rw-r--r--src/fb/rotate_cube.c2
-rw-r--r--src/fb/stencil_test.c2
-rw-r--r--src/fb_rawshader/alpha_blend.c2
-rw-r--r--src/fb_rawshader/cube_companion.c2
-rw-r--r--src/fb_rawshader/cubemap_sphere.c2
-rw-r--r--src/fb_rawshader/displacement.c2
-rw-r--r--src/fb_rawshader/etna_gears.c2
-rw-r--r--src/fb_rawshader/mip_cube.c2
-rw-r--r--src/fb_rawshader/particle_system.c2
-rw-r--r--src/fb_rawshader/rotate_cube.c2
-rw-r--r--src/fb_rawshader/stencil_test.c2
-rw-r--r--src/lib/fbdemos.c6
-rw-r--r--src/lib/fbdemos.h2
22 files changed, 57 insertions, 55 deletions
diff --git a/src/etnaviv/etna_rs.c b/src/etnaviv/etna_rs.c
index 873bd59..a03662a 100644
--- a/src/etnaviv/etna_rs.c
+++ b/src/etnaviv/etna_rs.c
@@ -126,39 +126,41 @@ void etna_submit_rs_state(struct etna_ctx *restrict ctx, const struct compiled_r
}
else if (ctx->conn->chip.pixel_pipes == 2)
{
- etna_reserve(ctx, 32);
- /*0 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_CONFIG>>2, 5, 0);
+ etna_reserve(ctx, 34);
+ /*0 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_CONFIG>>2, 1, 0);
/*1 */ ETNA_EMIT(ctx, cs->RS_CONFIG);
- /*2 */ ETNA_EMIT(ctx, cs->RS_SOURCE_STRIDE);
- /*3 */ ETNA_EMIT(ctx, cs->RS_DEST_ADDR);
- /*4 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_PIPE_SOURCE_ADDR(0)>>2, 2, 0);
- /*5 */ ETNA_EMIT(ctx, cs->RS_PIPE_SOURCE_ADDR[0]);
- /*6 */ ETNA_EMIT(ctx, cs->RS_PIPE_SOURCE_ADDR[1]);
- /*7 */ ETNA_EMIT(ctx, 0x00000000); /* pad */
- /*8 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_PIPE_DEST_ADDR(0)>>2, 2, 0);
- /*9 */ ETNA_EMIT(ctx, cs->RS_PIPE_DEST_ADDR[0]);
- /*10*/ ETNA_EMIT(ctx, cs->RS_PIPE_DEST_ADDR[1]);
- /*11*/ ETNA_EMIT(ctx, 0x00000000); /* pad */
- /*12*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_PIPE_OFFSET(0)>>2, 2, 0);
- /*13*/ ETNA_EMIT(ctx, cs->RS_PIPE_OFFSET[0]);
- /*14*/ ETNA_EMIT(ctx, cs->RS_PIPE_OFFSET[1]);
- /*15*/ ETNA_EMIT(ctx, 0x00000000); /* pad */
- /*16*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_WINDOW_SIZE>>2, 1, 0);
- /*17*/ ETNA_EMIT(ctx, cs->RS_WINDOW_SIZE);
- /*18*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_DITHER(0)>>2, 2, 0);
- /*19*/ ETNA_EMIT(ctx, cs->RS_DITHER[0]);
- /*20*/ ETNA_EMIT(ctx, cs->RS_DITHER[1]);
- /*21*/ ETNA_EMIT(ctx, 0xbabb1e); /* pad */
- /*22*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_CLEAR_CONTROL>>2, 5, 0);
- /*23*/ ETNA_EMIT(ctx, cs->RS_CLEAR_CONTROL);
- /*24*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[0]);
- /*25*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[1]);
- /*26*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[2]);
- /*27*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[3]);
- /*28*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_EXTRA_CONFIG>>2, 1, 0);
- /*29*/ ETNA_EMIT(ctx, cs->RS_EXTRA_CONFIG);
- /*30*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_KICKER>>2, 1, 0);
- /*31*/ ETNA_EMIT(ctx, 0xbeebbeeb);
+ /*2 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_SOURCE_STRIDE>>2, 1, 0);
+ /*3 */ ETNA_EMIT(ctx, cs->RS_SOURCE_STRIDE);
+ /*4 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_DEST_STRIDE>>2, 1, 0);
+ /*5 */ ETNA_EMIT(ctx, cs->RS_DEST_STRIDE);
+ /*6 */ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_PIPE_SOURCE_ADDR(0)>>2, 2, 0);
+ /*7 */ ETNA_EMIT(ctx, cs->RS_PIPE_SOURCE_ADDR[0]);
+ /*8 */ ETNA_EMIT(ctx, cs->RS_PIPE_SOURCE_ADDR[1]);
+ /*9 */ ETNA_EMIT(ctx, 0x00000000); /* pad */
+ /*10*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_PIPE_DEST_ADDR(0)>>2, 2, 0);
+ /*11*/ ETNA_EMIT(ctx, cs->RS_PIPE_DEST_ADDR[0]);
+ /*12*/ ETNA_EMIT(ctx, cs->RS_PIPE_DEST_ADDR[1]);
+ /*13*/ ETNA_EMIT(ctx, 0x00000000); /* pad */
+ /*14*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_PIPE_OFFSET(0)>>2, 2, 0);
+ /*15*/ ETNA_EMIT(ctx, cs->RS_PIPE_OFFSET[0]);
+ /*16*/ ETNA_EMIT(ctx, cs->RS_PIPE_OFFSET[1]);
+ /*17*/ ETNA_EMIT(ctx, 0x00000000); /* pad */
+ /*18*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_WINDOW_SIZE>>2, 1, 0);
+ /*19*/ ETNA_EMIT(ctx, cs->RS_WINDOW_SIZE);
+ /*20*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_DITHER(0)>>2, 2, 0);
+ /*21*/ ETNA_EMIT(ctx, cs->RS_DITHER[0]);
+ /*22*/ ETNA_EMIT(ctx, cs->RS_DITHER[1]);
+ /*23*/ ETNA_EMIT(ctx, 0xbabb1e); /* pad */
+ /*24*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_CLEAR_CONTROL>>2, 5, 0);
+ /*25*/ ETNA_EMIT(ctx, cs->RS_CLEAR_CONTROL);
+ /*26*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[0]);
+ /*27*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[1]);
+ /*28*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[2]);
+ /*29*/ ETNA_EMIT(ctx, cs->RS_FILL_VALUE[3]);
+ /*30*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_EXTRA_CONFIG>>2, 1, 0);
+ /*31*/ ETNA_EMIT(ctx, cs->RS_EXTRA_CONFIG);
+ /*32*/ ETNA_EMIT_LOAD_STATE(ctx, VIVS_RS_KICKER>>2, 1, 0);
+ /*33*/ ETNA_EMIT(ctx, 0xbeebbeeb);
}
}
diff --git a/src/fb/alpha_blend.c b/src/fb/alpha_blend.c
index 376f3ab..8ff59c6 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 424977e..2aad4df 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 07a4403..2efa45c 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 0df78af..032fe12 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 d197078..2b2dae1 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 0e7f8b0..9c668f0 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 410b20b..8ffad7a 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 8988977..02228df 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 121d75b..9f2731a 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 45bec5f..93e1b9a 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 12f79e4..b9e8495 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 b5d706c..c8c4861 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 e58c27c..05605a3 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 e07c2e5..e8f9426 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 305879c..12e2ae6 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 702d5c4..4e7ebba 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 fecd87e..eb97458 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 ed2a384..3d3d55b 100644
--- a/src/lib/fbdemos.c
+++ b/src/lib/fbdemos.c
@@ -277,10 +277,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;
@@ -289,7 +289,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 e39285e..f3604df 100644
--- a/src/lib/fbdemos.h
+++ b/src/lib/fbdemos.h
@@ -86,7 +86,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);