OSDN Git Service

anv: Add pipeline_has_stage guards a few places
[android-x86/external-mesa.git] / src / intel / vulkan / genX_l3.c
index 0d36e3c..8b3b8ac 100644 (file)
@@ -315,10 +315,13 @@ get_pipeline_state_l3_weights(const struct anv_pipeline *pipeline)
    bool needs_dc = false, needs_slm = false;
 
    for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
+      if (!anv_pipeline_has_stage(pipeline, i))
+         continue;
+
       const struct brw_stage_prog_data *prog_data = pipeline->prog_data[i];
 
       needs_dc |= pipeline->needs_data_cache;
-      needs_slm |= prog_data && prog_data->total_shared;
+      needs_slm |= prog_data->total_shared;
    }
 
    return get_default_l3_weights(&pipeline->device->info,