summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-05-04 19:05:14 -0500
committerNicolai Hähnle <[email protected]>2016-05-09 11:52:46 -0500
commitd8f3e8e6263214caa9daf914487595e6bd5aa0df (patch)
treed77a3aa78a3cd5097b243e5461c4e813accfe47e
parentad1782cfb5eaa633582c8a7d026690878ab54064 (diff)
radeonsi: always allocate export memory for pixel shaders
Experiments with framebuffer-no-attachments type draw calls have shown that NULL exports stall terribly unless we ensure that export memory is allocated by the SPI. Reviewed-by: Marek Olšák <[email protected]>
-rw-r--r--src/gallium/drivers/radeonsi/si_state_shaders.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/radeonsi/si_state_shaders.c b/src/gallium/drivers/radeonsi/si_state_shaders.c
index 0bfd7e8d111..11e73098253 100644
--- a/src/gallium/drivers/radeonsi/si_state_shaders.c
+++ b/src/gallium/drivers/radeonsi/si_state_shaders.c
@@ -688,14 +688,19 @@ static void si_shader_ps(struct si_shader *shader)
spi_shader_col_format = si_get_spi_shader_col_format(shader);
cb_shader_mask = si_get_cb_shader_mask(spi_shader_col_format);
- /* This must be non-zero for alpha-test/kill to work.
- * The hardware ignores the EXEC mask if no export memory is allocated.
+ /* Ensure that some export memory is always allocated, for two reasons:
+ *
+ * 1) Correctness: The hardware ignores the EXEC mask if no export
+ * memory is allocated, so KILL and alpha test do not work correctly
+ * without this.
+ * 2) Performance: Every shader needs at least a NULL export, even when
+ * it writes no color/depth output. The NULL export instruction
+ * stalls without this setting.
+ *
* Don't add this to CB_SHADER_MASK.
*/
if (!spi_shader_col_format &&
- !info->writes_z && !info->writes_stencil && !info->writes_samplemask &&
- (shader->selector->info.uses_kill ||
- shader->key.ps.epilog.alpha_func != PIPE_FUNC_ALWAYS))
+ !info->writes_z && !info->writes_stencil && !info->writes_samplemask)
spi_shader_col_format = V_028714_SPI_SHADER_32_R;
si_pm4_set_reg(pm4, R_0286CC_SPI_PS_INPUT_ENA, input_ena);