diff --git a/src/compiler/shader_info.h b/src/compiler/shader_info.h index e1be926e6e1..1acb1825fd5 100644 --- a/src/compiler/shader_info.h +++ b/src/compiler/shader_info.h @@ -347,6 +347,7 @@ typedef struct shader_info { struct { uint16_t local_size[3]; + uint16_t local_size_hint[3]; bool local_size_variable:1; uint8_t user_data_components_amd:3; diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c index a5288a6032c..b8b6397c525 100644 --- a/src/compiler/spirv/spirv_to_nir.c +++ b/src/compiler/spirv/spirv_to_nir.c @@ -4639,6 +4639,13 @@ vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point, b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_UNCHANGED; break; + case SpvExecutionModeLocalSizeHint: + vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); + b->shader->info.cs.local_size_hint[0] = mode->operands[0]; + b->shader->info.cs.local_size_hint[1] = mode->operands[1]; + b->shader->info.cs.local_size_hint[2] = mode->operands[2]; + break; + case SpvExecutionModeLocalSize: vtn_assert(gl_shader_stage_is_compute(b->shader->info.stage)); b->shader->info.cs.local_size[0] = mode->operands[0]; @@ -4646,9 +4653,6 @@ vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point, b->shader->info.cs.local_size[2] = mode->operands[2]; break; - case SpvExecutionModeLocalSizeHint: - break; /* Nothing to do with this */ - case SpvExecutionModeOutputVertices: if (b->shader->info.stage == MESA_SHADER_TESS_CTRL || b->shader->info.stage == MESA_SHADER_TESS_EVAL) { @@ -4854,7 +4858,10 @@ vtn_handle_execution_mode_id(struct vtn_builder *b, struct vtn_value *entry_poin break; case SpvExecutionModeLocalSizeHintId: - /* Nothing to do with this hint. */ + vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); + b->shader->info.cs.local_size_hint[0] = vtn_constant_uint(b, mode->operands[0]); + b->shader->info.cs.local_size_hint[1] = vtn_constant_uint(b, mode->operands[1]); + b->shader->info.cs.local_size_hint[2] = vtn_constant_uint(b, mode->operands[2]); break; default: