radv/gfx10: fix VK_KHR_pipeline_executable_properties with NGG GS
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 18 Sep 2019 14:58:06 +0000 (16:58 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 18 Sep 2019 19:19:28 +0000 (21:19 +0200)
No GS copy shader if a pipeline enables NGG GS.

This fixes
dEQP-VK.pipeline.executable_properties.graphics.*geometry_stage*.

Fixes: 86864eedd2d ("radv: Implement radv_GetPipelineExecutablePropertiesKHR.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_pipeline.c

index 947c0694a87f996e22d848574adb39bb0b048a2f..a6aad38eafe8e599e8aaad8311985ca0b8eff129 100644 (file)
@@ -4923,8 +4923,15 @@ static uint32_t radv_get_executable_count(const struct radv_pipeline *pipeline)
 {
        uint32_t ret = 0;
        for (int i = 0; i < MESA_SHADER_STAGES; ++i) {
-               if (pipeline->shaders[i])
-                       ret += i == MESA_SHADER_GEOMETRY ? 2u : 1u;
+               if (!pipeline->shaders[i])
+                       continue;
+
+               if (i == MESA_SHADER_GEOMETRY &&
+                   !radv_pipeline_has_ngg(pipeline)) {
+                       ret += 2u;
+               } else {
+                       ret += 1u;
+               }
                
        }
        return ret;
@@ -4943,7 +4950,8 @@ radv_get_shader_from_executable_index(const struct radv_pipeline *pipeline, int
 
                --index;
 
-               if (i == MESA_SHADER_GEOMETRY) {
+               if (i == MESA_SHADER_GEOMETRY &&
+                   !radv_pipeline_has_ngg(pipeline)) {
                        if (!index) {
                                *stage = i;
                                return pipeline->gs_copy_shader;
@@ -5034,7 +5042,8 @@ VkResult radv_GetPipelineExecutablePropertiesKHR(
                desc_copy(pProperties[executable_idx].description, description);
 
                ++executable_idx;
-               if (i == MESA_SHADER_GEOMETRY) {
+               if (i == MESA_SHADER_GEOMETRY &&
+                   !radv_pipeline_has_ngg(pipeline)) {
                        assert(pipeline->gs_copy_shader);
                        if (executable_idx >= count)
                                break;