radv/gfx10: compute the LDS size for exporting PrimID for VS
[mesa.git] / src / amd / vulkan / radv_pipeline.c
index 97ab503bef31d49c1bb7d8982d915458cfc191bb..3e448db1fd532351deafd25ddcd38651cb31799e 100644 (file)
@@ -1751,6 +1751,15 @@ calculate_ngg_info(const VkGraphicsPipelineCreateInfo *pCreateInfo,
                if (es_info->info.so.num_outputs)
                        esvert_lds_size = 4 * es_info->info.so.num_outputs + 1;
                */
+
+               /* LDS size for passing data from GS to ES.
+                * GS stores Primitive IDs (one DWORD) into LDS at the address
+                * corresponding to the ES thread of the provoking vertex. All
+                * ES threads load and export PrimitiveID for their thread.
+                */
+               if (!radv_pipeline_has_tess(pipeline) &&
+                   pipeline->shaders[MESA_SHADER_VERTEX]->info.vs.export_prim_id)
+                       esvert_lds_size = MAX2(esvert_lds_size, 1);
        }
 
        unsigned max_gsprims = max_gsprims_base;
@@ -3212,7 +3221,7 @@ radv_pipeline_generate_binning_state(struct radeon_cmdbuf *ctx_cs,
                        fpovs_per_batch = 63;
                } else {
                        /* The context states are affected by the scissor bug. */
-                       context_states_per_bin = pipeline->device->physical_device->has_scissor_bug ? 1 : 6;
+                       context_states_per_bin = pipeline->device->physical_device->rad_info.has_gfx9_scissor_bug ? 1 : 6;
                        /* 32 causes hangs for RAVEN. */
                        persistent_states_per_bin = 16;
                        fpovs_per_batch = 63;
@@ -4055,7 +4064,7 @@ radv_compute_db_shader_control(const struct radv_device *device,
                z_order = V_02880C_LATE_Z;
 
        bool disable_rbplus = device->physical_device->rad_info.has_rbplus &&
-                             !device->physical_device->rbplus_allowed;
+                             !device->physical_device->rad_info.rbplus_allowed;
 
        /* It shouldn't be needed to export gl_SampleMask when MSAA is disabled
         * but this appears to break Project Cars (DXVK). See