lavapipe: Allow for texture types
Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13389>
This commit is contained in:
committed by
Marge Bot
parent
b8a0bf2343
commit
3c398139e1
@@ -471,12 +471,14 @@ static void
|
||||
ntt_setup_uniforms(struct ntt_compile *c)
|
||||
{
|
||||
nir_foreach_uniform_variable(var, c->s) {
|
||||
if (glsl_type_is_sampler(glsl_without_array(var->type))) {
|
||||
if (glsl_type_is_sampler(glsl_without_array(var->type)) ||
|
||||
glsl_type_is_texture(glsl_without_array(var->type))) {
|
||||
/* Don't use this size for the check for samplers -- arrays of structs
|
||||
* containing samplers should be ignored, and just the separate lowered
|
||||
* sampler uniform decl used.
|
||||
*/
|
||||
int size = glsl_type_get_sampler_count(var->type);
|
||||
int size = glsl_type_get_sampler_count(var->type) +
|
||||
glsl_type_get_texture_count(var->type);
|
||||
|
||||
const struct glsl_type *stype = glsl_without_array(var->type);
|
||||
enum tgsi_texture_type target = tgsi_texture_type_from_sampler_dim(glsl_get_sampler_dim(stype),
|
||||
|
||||
@@ -786,7 +786,8 @@ void nir_tgsi_scan_shader(const struct nir_shader *nir,
|
||||
|
||||
uint32_t sampler_mask = 0;
|
||||
nir_foreach_uniform_variable(var, nir) {
|
||||
uint32_t sampler_count = glsl_type_get_sampler_count(var->type);
|
||||
uint32_t sampler_count = glsl_type_get_sampler_count(var->type) +
|
||||
glsl_type_get_texture_count(var->type);
|
||||
sampler_mask |= ((1ull << sampler_count) - 1) << var->data.binding;
|
||||
}
|
||||
uint32_t image_mask = 0;
|
||||
|
||||
@@ -220,7 +220,7 @@ void lvp_lower_pipeline_layout(const struct lvp_device *device,
|
||||
struct lvp_descriptor_set_binding_layout *binding = &layout->set[desc_set_idx].layout->binding[binding_idx];
|
||||
int value = 0;
|
||||
var->data.descriptor_set = 0;
|
||||
if (base_type == GLSL_TYPE_SAMPLER) {
|
||||
if (base_type == GLSL_TYPE_SAMPLER || base_type == GLSL_TYPE_TEXTURE) {
|
||||
if (binding->type == VK_DESCRIPTOR_TYPE_SAMPLER) {
|
||||
for (unsigned s = 0; s < desc_set_idx; s++)
|
||||
value += layout->set[s].layout->stage[shader->info.stage].sampler_count;
|
||||
|
||||
Reference in New Issue
Block a user