summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-12-04 13:48:10 -0800
committerEric Anholt <[email protected]>2018-12-07 16:48:23 -0800
commit504d06e4c1c5664c1e208179a43adbbd27fd4522 (patch)
treed67d493896a530c379508477abc1e4d74f057170 /src/gallium/drivers/v3d/v3dx_draw.c
parentd1965344ac26e250f696ff15f6dff8aacbd1d6db (diff)
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.
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_draw.c')
-rw-r--r--src/gallium/drivers/v3d/v3dx_draw.c15
1 files changed, 6 insertions, 9 deletions
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;