spirv: Handle the SubgroupSize execution mode

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12959>
This commit is contained in:
Jason Ekstrand 2020-09-14 13:39:47 -05:00 committed by Marge Bot
parent e5dc900226
commit 518693c3ec
2 changed files with 10 additions and 0 deletions

View File

@ -431,6 +431,11 @@ typedef struct shader_info {
*/
enum gl_derivative_group derivative_group:2;
/**
* Explicit subgroup size if set by the shader, otherwise 0.
*/
unsigned subgroup_size;
/**
* pointer size is:
* AddressingModelLogical: 0 (default)

View File

@ -5137,6 +5137,11 @@ vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point,
/* Handled later by vtn_handle_execution_mode_id(). */
break;
case SpvExecutionModeSubgroupSize:
vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL);
b->shader->info.cs.subgroup_size = mode->operands[0];
break;
case SpvExecutionModeSubgroupUniformControlFlowKHR:
/* There's no corresponding SPIR-V capability, so check here. */
vtn_fail_if(!b->options->caps.subgroup_uniform_control_flow,