radeonsi/gfx10: support pixel shaders without exports
authorMarek Olšák <marek.olsak@amd.com>
Thu, 27 Jun 2019 02:57:10 +0000 (22:57 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 9 Jul 2019 21:24:16 +0000 (17:24 -0400)
It only works if there are not color and no Z exports.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/radeonsi/si_state_shaders.c

index 380533b..3b95ed5 100644 (file)
@@ -1587,8 +1587,15 @@ static void si_shader_ps(struct si_screen *sscreen, struct si_shader *shader)
         *    stalls without this setting.
         *
         * Don't add this to CB_SHADER_MASK.
+        *
+        * GFX10 supports pixel shaders without exports by setting both
+        * the color and Z formats to SPI_SHADER_ZERO. The hw will skip export
+        * instructions if any are present.
         */
-       if (!spi_shader_col_format &&
+       if ((sscreen->info.chip_class <= GFX9 ||
+            info->uses_kill ||
+            shader->key.part.ps.epilog.alpha_func != PIPE_FUNC_ALWAYS) &&
+           !spi_shader_col_format &&
            !info->writes_z && !info->writes_stencil && !info->writes_samplemask)
                spi_shader_col_format = V_028714_SPI_SHADER_32_R;