nir/lower_cl_images: record image_buffers and msaa_images
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27385>
(cherry picked from commit 727cddd338
)
This commit is contained in:

committed by
Eric Engestrom

parent
4a1d925051
commit
ba1737d799
@@ -744,7 +744,7 @@
|
|||||||
"description": "nir/lower_cl_images: record image_buffers and msaa_images",
|
"description": "nir/lower_cl_images: record image_buffers and msaa_images",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 0,
|
"nomination_type": 0,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": null,
|
"because_sha": null,
|
||||||
"notes": null
|
"notes": null
|
||||||
|
@@ -114,6 +114,9 @@ nir_lower_cl_images(nir_shader *shader, bool lower_image_derefs, bool lower_samp
|
|||||||
|
|
||||||
ASSERTED int last_loc = -1;
|
ASSERTED int last_loc = -1;
|
||||||
int num_rd_images = 0, num_wr_images = 0;
|
int num_rd_images = 0, num_wr_images = 0;
|
||||||
|
|
||||||
|
BITSET_ZERO(shader->info.image_buffers);
|
||||||
|
BITSET_ZERO(shader->info.msaa_images);
|
||||||
nir_foreach_variable_with_modes(var, shader, nir_var_image | nir_var_uniform) {
|
nir_foreach_variable_with_modes(var, shader, nir_var_image | nir_var_uniform) {
|
||||||
if (!glsl_type_is_image(var->type) && !glsl_type_is_texture(var->type))
|
if (!glsl_type_is_image(var->type) && !glsl_type_is_texture(var->type))
|
||||||
continue;
|
continue;
|
||||||
@@ -128,6 +131,17 @@ nir_lower_cl_images(nir_shader *shader, bool lower_image_derefs, bool lower_samp
|
|||||||
else
|
else
|
||||||
var->data.driver_location = num_wr_images++;
|
var->data.driver_location = num_wr_images++;
|
||||||
var->data.binding = var->data.driver_location;
|
var->data.binding = var->data.driver_location;
|
||||||
|
|
||||||
|
switch (glsl_get_sampler_dim(var->type)) {
|
||||||
|
case GLSL_SAMPLER_DIM_BUF:
|
||||||
|
BITSET_SET(shader->info.image_buffers, var->data.binding);
|
||||||
|
break;
|
||||||
|
case GLSL_SAMPLER_DIM_MS:
|
||||||
|
BITSET_SET(shader->info.msaa_images, var->data.binding);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
shader->info.num_textures = num_rd_images;
|
shader->info.num_textures = num_rd_images;
|
||||||
BITSET_ZERO(shader->info.textures_used);
|
BITSET_ZERO(shader->info.textures_used);
|
||||||
|
Reference in New Issue
Block a user