From 504d06e4c1c5664c1e208179a43adbbd27fd4522 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 4 Dec 2018 13:48:10 -0800 Subject: v3d: Make an array for frag/vert texture state in the context. This simplifies a bunch of our texture handling, while introducing the slots necessary for adding new shader stages. --- src/gallium/drivers/v3d/v3dx_draw.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/gallium/drivers/v3d/v3dx_draw.c') diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 051907f1250..519aa9157d5 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -146,16 +146,13 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d, /* Upload the uniforms to the indirect CL first */ struct v3d_cl_reloc fs_uniforms = v3d_write_uniforms(v3d, v3d->prog.fs, - &v3d->constbuf[PIPE_SHADER_FRAGMENT], - &v3d->fragtex); + PIPE_SHADER_FRAGMENT); struct v3d_cl_reloc vs_uniforms = v3d_write_uniforms(v3d, v3d->prog.vs, - &v3d->constbuf[PIPE_SHADER_VERTEX], - &v3d->verttex); + PIPE_SHADER_VERTEX); struct v3d_cl_reloc cs_uniforms = v3d_write_uniforms(v3d, v3d->prog.cs, - &v3d->constbuf[PIPE_SHADER_VERTEX], - &v3d->verttex); + PIPE_SHADER_VERTEX); /* See GFXH-930 workaround below */ uint32_t num_elements_to_emit = MAX2(vtx->num_elements, 1); @@ -438,8 +435,8 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) /* Before setting up the draw, flush anything writing to the textures * that we read from. */ - v3d_predraw_check_textures(pctx, &v3d->verttex); - v3d_predraw_check_textures(pctx, &v3d->fragtex); + for (int s = 0; s < PIPE_SHADER_TYPES; s++) + v3d_predraw_check_textures(pctx, &v3d->tex[s]); struct v3d_job *job = v3d_get_job_for_fbo(v3d); @@ -451,7 +448,7 @@ v3d_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) * on the last submitted render, rather than tracking the last * rendering to each texture's BO. */ - if (v3d->verttex.num_textures) { + if (v3d->tex[PIPE_SHADER_VERTEX].num_textures) { perf_debug("Blocking binner on last render " "due to vertex texturing.\n"); job->submit.in_sync_bcl = v3d->out_sync; -- cgit v1.2.3