diff options
author | Eric Anholt <[email protected]> | 2019-04-24 11:26:34 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-04-26 12:42:30 -0700 |
commit | 42210a4351fbb53a44eb49f31a12e86d7a84ffa4 (patch) | |
tree | 3ea2dd104ad97fbd2c151553aaf00d9e311f516e | |
parent | 448fc3ea427ed0edebe2ab5f81c585a5273bafd3 (diff) |
v3d: Apply the GFXH-930 workaround to the case where the VS loads attrs.
We were emitting a dummy load for when the VS doesn't load any attributes,
but we also need to emit a dummy load for when the render VS loads
attributes but the binner VS doesn't. Fixes simulator assertion failures
and GPU hangs on KHR-GLES31.core.texture_gather.\*
-rw-r--r-- | src/gallium/drivers/v3d/v3dx_draw.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c index 486b6cc9b12..0c8eb66b939 100644 --- a/src/gallium/drivers/v3d/v3dx_draw.c +++ b/src/gallium/drivers/v3d/v3dx_draw.c @@ -322,6 +322,7 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d, vtx->defaults_offset); } + bool cs_loaded_any = false; for (int i = 0; i < vtx->num_elements; i++) { struct pipe_vertex_element *elem = &vtx->pipe[i]; struct pipe_vertex_buffer *vb = @@ -341,6 +342,20 @@ v3d_emit_gl_shader_state(struct v3d_context *v3d, v3d->prog.cs->prog_data.vs->vattr_sizes[i]; attr.number_of_values_read_by_vertex_shader = v3d->prog.vs->prog_data.vs->vattr_sizes[i]; + + /* GFXH-930: At least one attribute must be enabled + * and read by CS and VS. If we have attributes being + * consumed by the VS but not the CS, then set up a + * dummy load of the last attribute into the CS's VPM + * inputs. (Since CS is just dead-code-elimination + * compared to VS, we can't have CS loading but not + * VS). + */ + if (v3d->prog.cs->prog_data.vs->vattr_sizes[i]) + cs_loaded_any = true; + if (i == vtx->num_elements - 1 && !cs_loaded_any) { + attr.number_of_values_read_by_coordinate_shader = 1; + } #if V3D_VERSION >= 41 attr.maximum_index = 0xffffff; #endif |