mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
zink: add function to check whether a shader has cube samplers
Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18197>
This commit is contained in:
parent
5489b1a8ff
commit
3652ca08aa
2 changed files with 13 additions and 0 deletions
|
|
@ -3369,3 +3369,14 @@ zink_shader_tcs_create(struct zink_screen *screen, struct zink_shader *vs, unsig
|
|||
ret->is_generated = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool
|
||||
zink_shader_has_cubes(nir_shader *nir)
|
||||
{
|
||||
nir_foreach_variable_with_modes(var, nir, nir_var_uniform) {
|
||||
const struct glsl_type *type = glsl_without_array(var->type);
|
||||
if (glsl_type_is_sampler(type) && glsl_get_sampler_dim(type) == GLSL_SAMPLER_DIM_CUBE)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,4 +80,6 @@ zink_shader_descriptor_is_buffer(struct zink_shader *zs, enum zink_descriptor_ty
|
|||
zs->bindings[type][i].type == VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER;
|
||||
}
|
||||
|
||||
bool
|
||||
zink_shader_has_cubes(nir_shader *nir);
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue