mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 15:50:17 +01:00
glsl: set shader_info.subgroup_size for KHR_shader_subgroup
Signed-off-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30610>
This commit is contained in:
parent
ea33876fbe
commit
40fdd97de3
4 changed files with 8 additions and 2 deletions
|
|
@ -2473,6 +2473,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader,
|
|||
shader->has_implicit_conversions = state->has_implicit_conversions();
|
||||
shader->has_implicit_int_to_uint_conversion =
|
||||
state->has_implicit_int_to_uint_conversion();
|
||||
shader->KHR_shader_subgroup_basic_enable = state->KHR_shader_subgroup_basic_enable;
|
||||
|
||||
struct gl_shader_compiler_options *options =
|
||||
&ctx->Const.ShaderCompilerOptions[shader->Stage];
|
||||
|
|
|
|||
|
|
@ -172,8 +172,6 @@ glsl_to_nir(const struct gl_constants *consts,
|
|||
nir_print_shader(shader, stdout);
|
||||
}
|
||||
|
||||
shader->info.subgroup_size = SUBGROUP_SIZE_UNIFORM;
|
||||
|
||||
return shader;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1540,6 +1540,7 @@ link_intrastage_shaders(void *mem_ctx,
|
|||
bool allow_missing_main)
|
||||
{
|
||||
bool arb_fragment_coord_conventions_enable = false;
|
||||
bool KHR_shader_subgroup_basic_enable = false;
|
||||
|
||||
/* Check that global variables defined in multiple shaders are consistent.
|
||||
*/
|
||||
|
|
@ -1551,6 +1552,8 @@ link_intrastage_shaders(void *mem_ctx,
|
|||
false);
|
||||
if (shader_list[i]->ARB_fragment_coord_conventions_enable)
|
||||
arb_fragment_coord_conventions_enable = true;
|
||||
if (shader_list[i]->KHR_shader_subgroup_basic_enable)
|
||||
KHR_shader_subgroup_basic_enable = true;
|
||||
}
|
||||
|
||||
if (!prog->data->LinkStatus)
|
||||
|
|
@ -1660,6 +1663,9 @@ link_intrastage_shaders(void *mem_ctx,
|
|||
|
||||
populate_symbol_table(linked, shader_list[0]->symbols);
|
||||
|
||||
gl_prog->info.subgroup_size = KHR_shader_subgroup_basic_enable ?
|
||||
SUBGROUP_SIZE_API_CONSTANT : SUBGROUP_SIZE_UNIFORM;
|
||||
|
||||
/* The pointer to the main function in the final linked shader (i.e., the
|
||||
* copy of the original shader that contained the main function).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@ struct gl_shader
|
|||
bool EarlyFragmentTests;
|
||||
|
||||
bool ARB_fragment_coord_conventions_enable;
|
||||
bool KHR_shader_subgroup_basic_enable;
|
||||
|
||||
bool redeclares_gl_fragcoord;
|
||||
bool uses_gl_fragcoord;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue