summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2023-01-28 08:56:54 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2023-01-28 08:56:54 +0000
commitd305570c9b1fd87c4acdec589761cfa39fd04a3b (patch)
treee340315dd9d6966ccc3a48aa7a845e2213e40e62 /lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c
parent1c5c7896c1d54abd25c0f33ca996165b359eecb3 (diff)
Merge Mesa 22.3.4
Diffstat (limited to 'lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c')
-rw-r--r--lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c b/lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c
index c55e3403b..fda5eb25b 100644
--- a/lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c
+++ b/lib/mesa/src/gallium/drivers/freedreno/a5xx/fd5_program.c
@@ -88,7 +88,7 @@ static void
emit_stream_out(struct fd_ringbuffer *ring, const struct ir3_shader_variant *v,
struct ir3_shader_linkage *l)
{
- const struct ir3_stream_output_info *strmout = &v->shader->stream_output;
+ const struct ir3_stream_output_info *strmout = &v->stream_output;
unsigned ncomp[PIPE_MAX_SO_BUFFERS] = {0};
unsigned prog[align(l->max_loc, 2) / 2];
@@ -108,7 +108,7 @@ emit_stream_out(struct fd_ringbuffer *ring, const struct ir3_shader_variant *v,
if (l->var[idx].slot == v->outputs[k].slot)
break;
- debug_assert(idx < l->cnt);
+ assert(idx < l->cnt);
for (unsigned j = 0; j < out->num_components; j++) {
unsigned c = j + out->start_component;
@@ -249,7 +249,7 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
setup_stages(emit, s);
- bool do_streamout = (s[VS].v->shader->stream_output.num_outputs > 0);
+ bool do_streamout = (s[VS].v->stream_output.num_outputs > 0);
uint8_t clip_mask = s[VS].v->clip_mask,
cull_mask = s[VS].v->cull_mask;
uint8_t clip_cull_mask = clip_mask | cull_mask;
@@ -381,7 +381,14 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
ring,
A5XX_SP_VS_CTRL_REG0_HALFREGFOOTPRINT(s[VS].i->max_half_reg + 1) |
A5XX_SP_VS_CTRL_REG0_FULLREGFOOTPRINT(s[VS].i->max_reg + 1) |
- 0x6 | /* XXX seems to be always set? */
+ COND(s[VS].instrlen != 0, A5XX_SP_VS_CTRL_REG0_BUFFER) |
+ /* XXX: 0x2 is only unset in
+ * dEQP-GLES3.functional.ubo.single_nested_struct_array.single_buffer.packed_instance_array_vertex
+ * on a collection of blob traces. That shader is 1091 instrs, 0
+ * half, 3 full, 108 constlen. Other >1091 instr non-VS shaders don't
+ * unset it, so that's not the trick.
+ */
+ 0x2 |
A5XX_SP_VS_CTRL_REG0_BRANCHSTACK(ir3_shader_branchstack_hw(s[VS].v)) |
COND(s[VS].v->need_pixlod, A5XX_SP_VS_CTRL_REG0_PIXLODENABLE));
@@ -511,7 +518,7 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
OUT_RING(ring, A5XX_HLSQ_CONTROL_2_REG_FACEREGID(face_regid) |
A5XX_HLSQ_CONTROL_2_REG_SAMPLEID(samp_id_regid) |
A5XX_HLSQ_CONTROL_2_REG_SAMPLEMASK(samp_mask_regid) |
- A5XX_HLSQ_CONTROL_2_REG_SIZE(ij_regid[IJ_PERSP_SIZE]));
+ A5XX_HLSQ_CONTROL_2_REG_CENTERRHW(ij_regid[IJ_PERSP_CENTER_RHW]));
OUT_RING(
ring,
A5XX_HLSQ_CONTROL_3_REG_IJ_PERSP_PIXEL(ij_regid[IJ_PERSP_PIXEL]) |
@@ -531,7 +538,8 @@ fd5_program_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
OUT_RING(
ring,
COND(s[FS].v->total_in > 0, A5XX_SP_FS_CTRL_REG0_VARYING) |
- 0x40006 | /* XXX set pretty much everywhere */
+ 0x40002 | /* XXX set pretty much everywhere */
+ COND(s[FS].instrlen != 0, A5XX_SP_FS_CTRL_REG0_BUFFER) |
A5XX_SP_FS_CTRL_REG0_THREADSIZE(fssz) |
A5XX_SP_FS_CTRL_REG0_HALFREGFOOTPRINT(s[FS].i->max_half_reg + 1) |
A5XX_SP_FS_CTRL_REG0_FULLREGFOOTPRINT(s[FS].i->max_reg + 1) |