llvmpipe: bind sampler views/images properly.

There is some code that relies on TGSI here, and it has limits.
For now always just bind resources > 31.

Fixes
dEQP-VK.pipeline.pipeline_library.descriptor_limits*

Cc: mesa-stable
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18812>
(cherry picked from commit 16fd0c11c6)
This commit is contained in:
Dave Airlie
2022-09-26 08:44:56 +10:00
committed by Dylan Baker
parent 1cfa6ef606
commit 73e50fdb0f
3 changed files with 8 additions and 8 deletions

View File

@@ -490,7 +490,7 @@
"description": "llvmpipe: bind sampler views/images properly.",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null
},

View File

@@ -634,7 +634,7 @@ make_variant_key(struct llvmpipe_context *lp,
* This will still work, the only downside is that not actually
* used views may be included in the shader key.
*/
if(shader->info.base.file_mask[TGSI_FILE_SAMPLER_VIEW] & (1u << (i & 31))) {
if((shader->info.base.file_mask[TGSI_FILE_SAMPLER_VIEW] & (1u << (i & 31))) || i > 31) {
lp_sampler_static_texture_state(&cs_sampler[i].texture_state,
lp->sampler_views[PIPE_SHADER_COMPUTE][i]);
}
@@ -643,7 +643,7 @@ make_variant_key(struct llvmpipe_context *lp,
else {
key->nr_sampler_views = key->nr_samplers;
for(i = 0; i < key->nr_sampler_views; ++i) {
if(shader->info.base.file_mask[TGSI_FILE_SAMPLER] & (1 << i)) {
if((shader->info.base.file_mask[TGSI_FILE_SAMPLER] & (1 << i)) || i > 31) {
lp_sampler_static_texture_state(&cs_sampler[i].texture_state,
lp->sampler_views[PIPE_SHADER_COMPUTE][i]);
}
@@ -657,7 +657,7 @@ make_variant_key(struct llvmpipe_context *lp,
memset(lp_image, 0,
key->nr_images * sizeof *lp_image);
for (i = 0; i < key->nr_images; ++i) {
if (shader->info.base.file_mask[TGSI_FILE_IMAGE] & (1 << i)) {
if ((shader->info.base.file_mask[TGSI_FILE_IMAGE] & (1 << i)) || i > 31) {
lp_sampler_static_texture_state_image(&lp_image[i].image_state,
&lp->images[PIPE_SHADER_COMPUTE][i]);
}

View File

@@ -4466,8 +4466,8 @@ make_variant_key(struct llvmpipe_context *lp,
* This will still work, the only downside is that not actually
* used views may be included in the shader key.
*/
if (shader->info.base.file_mask[TGSI_FILE_SAMPLER_VIEW]
& (1u << (i & 31))) {
if ((shader->info.base.file_mask[TGSI_FILE_SAMPLER_VIEW]
& (1u << (i & 31))) || i > 31) {
lp_sampler_static_texture_state(&fs_sampler[i].texture_state,
lp->sampler_views[PIPE_SHADER_FRAGMENT][i]);
}
@@ -4476,7 +4476,7 @@ make_variant_key(struct llvmpipe_context *lp,
else {
key->nr_sampler_views = key->nr_samplers;
for (unsigned i = 0; i < key->nr_sampler_views; ++i) {
if (shader->info.base.file_mask[TGSI_FILE_SAMPLER] & (1 << i)) {
if ((shader->info.base.file_mask[TGSI_FILE_SAMPLER] & (1 << i)) || i > 31) {
lp_sampler_static_texture_state(&fs_sampler[i].texture_state,
lp->sampler_views[PIPE_SHADER_FRAGMENT][i]);
}
@@ -4490,7 +4490,7 @@ make_variant_key(struct llvmpipe_context *lp,
memset(lp_image, 0,
key->nr_images * sizeof *lp_image);
for (unsigned i = 0; i < key->nr_images; ++i) {
if (shader->info.base.file_mask[TGSI_FILE_IMAGE] & (1 << i)) {
if ((shader->info.base.file_mask[TGSI_FILE_IMAGE] & (1 << i)) || i > 31) {
lp_sampler_static_texture_state_image(&lp_image[i].image_state,
&lp->images[PIPE_SHADER_FRAGMENT][i]);
}