summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-10-02 09:50:44 -0700
committerEric Anholt <[email protected]>2014-10-09 21:47:06 +0200
commitc4b0dd53568fa276079f6b6bf7ba4b857ddd65a5 (patch)
tree519caad30e267a0a8d093bed05b91e6aa4419297 /src/gallium/drivers/vc4/vc4_draw.c
parent5c72d7706c55d2832b816af4192afa010de51636 (diff)
vc4: Split the coordinate shader to its own vc4_compiled_shader.
Merging VS and CS into the same struct wasn't winning us anything except for not allocating a separate BO (but if we want to pack programs into BOs, we should pack not just those 2 programs together). What it was getting us was a bunch of code duplication about hash table lookups and propagating vc4_compile contents into a vc4_compiled_shader. I was about to make the situation worse with indirect uniform buffer access.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_draw.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_draw.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gallium/drivers/vc4/vc4_draw.c b/src/gallium/drivers/vc4/vc4_draw.c
index f4437183f99..2cac7efb620 100644
--- a/src/gallium/drivers/vc4/vc4_draw.c
+++ b/src/gallium/drivers/vc4/vc4_draw.c
@@ -106,16 +106,13 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
vc4_write_uniforms(vc4, vc4->prog.fs,
&vc4->constbuf[PIPE_SHADER_FRAGMENT],
- &vc4->fragtex,
- 0);
+ &vc4->fragtex);
vc4_write_uniforms(vc4, vc4->prog.vs,
&vc4->constbuf[PIPE_SHADER_VERTEX],
- &vc4->verttex,
- 0);
- vc4_write_uniforms(vc4, vc4->prog.vs,
+ &vc4->verttex);
+ vc4_write_uniforms(vc4, vc4->prog.cs,
&vc4->constbuf[PIPE_SHADER_VERTEX],
- &vc4->verttex,
- 1);
+ &vc4->verttex);
/* Emit the shader record. */
cl_start_shader_reloc(&vc4->shader_rec, 3 + vtx->num_elements);
@@ -137,9 +134,8 @@ vc4_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info)
cl_u16(&vc4->shader_rec, 0); /* cs num uniforms */
cl_u8(&vc4->shader_rec, (1 << vtx->num_elements) - 1); /* cs attribute array bitfield */
- cl_u8(&vc4->shader_rec, 16 * vtx->num_elements); /* vs total attribute size */
- cl_reloc(vc4, &vc4->shader_rec, vc4->prog.vs->bo,
- vc4->prog.vs->coord_shader_offset);
+ cl_u8(&vc4->shader_rec, 16 * vtx->num_elements); /* cs total attribute size */
+ cl_reloc(vc4, &vc4->shader_rec, vc4->prog.cs->bo, 0);
cl_u32(&vc4->shader_rec, 0); /* UBO offset written by kernel */
uint32_t max_index = 0xffff;