compiler/spirv: Handle the LocalSizeHint execution modes

It's basically the same as the LocalSize version except it fills
the local_size_hint array.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7565>
This commit is contained in:
Boris Brezillon
2020-04-14 01:56:20 -07:00
committed by Marge Bot
parent a42c846d24
commit 7d3aec9905
2 changed files with 12 additions and 4 deletions

View File

@@ -347,6 +347,7 @@ typedef struct shader_info {
struct { struct {
uint16_t local_size[3]; uint16_t local_size[3];
uint16_t local_size_hint[3];
bool local_size_variable:1; bool local_size_variable:1;
uint8_t user_data_components_amd:3; uint8_t user_data_components_amd:3;

View File

@@ -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; b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_UNCHANGED;
break; 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: case SpvExecutionModeLocalSize:
vtn_assert(gl_shader_stage_is_compute(b->shader->info.stage)); vtn_assert(gl_shader_stage_is_compute(b->shader->info.stage));
b->shader->info.cs.local_size[0] = mode->operands[0]; 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]; b->shader->info.cs.local_size[2] = mode->operands[2];
break; break;
case SpvExecutionModeLocalSizeHint:
break; /* Nothing to do with this */
case SpvExecutionModeOutputVertices: case SpvExecutionModeOutputVertices:
if (b->shader->info.stage == MESA_SHADER_TESS_CTRL || if (b->shader->info.stage == MESA_SHADER_TESS_CTRL ||
b->shader->info.stage == MESA_SHADER_TESS_EVAL) { 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; break;
case SpvExecutionModeLocalSizeHintId: 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; break;
default: default: