virgl: Lower binding start into buffer indices

This requires that we limit the number of max combinded SSBOs to 31,
otherwisewe shaders that use SSBO binding points with higher values
will break on the host.

Fixes CTS:
  KHR-GL43.shader_storage_buffer_object.basic-atomic-case1
  KHR-GL43.shader_storage_buffer_object.basic-atomic-case2
  KHR-GL43.shader_storage_buffer_object.advanced-indirectAddressing-case2
  KHR-GL43.shader_storage_buffer_object.advanced-usage-case1
  KHR-GL43.shader_storage_buffer_object.advanced-usage-sync
  KHR-GL43.shader_storage_buffer_object.advanced-matrix

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21586>
This commit is contained in:
Gert Wollny 2023-02-27 17:17:54 +01:00 committed by Marge Bot
parent 99416624e5
commit 3ddbf64e41
2 changed files with 3 additions and 6 deletions

View file

@ -44,11 +44,6 @@ KHR-GL43.shader_image_load_store.basic-allFormats-loadGeometryStages,Fail
KHR-GL43.shader_image_load_store.basic-allFormats-storeGeometryStages,Fail
KHR-GL43.shader_image_load_store.basic-allTargets-store,Fail
KHR-GL43.shader_image_load_store.incomplete_textures,Fail
KHR-GL43.shader_storage_buffer_object.advanced-indirectAddressing-case2,Fail
KHR-GL43.shader_storage_buffer_object.advanced-usage-case1,Fail
KHR-GL43.shader_storage_buffer_object.advanced-usage-sync,Fail
KHR-GL43.shader_storage_buffer_object.basic-atomic-case1,Fail
KHR-GL43.shader_storage_buffer_object.basic-atomic-case2,Fail
KHR-GL43.shader_subroutine.ssbo_atomic_image_load_store,Fail
KHR-Single-GL43.arrays_of_arrays_gl.InteractionArgumentAliasing1,Fail

View file

@ -714,7 +714,9 @@ static void *virgl_shader_encoder(struct pipe_context *ctx,
if (shader->type == PIPE_SHADER_IR_NIR) {
struct nir_to_tgsi_options options = {
.unoptimized_ra = true,
.lower_fabs = true
.lower_fabs = true,
.lower_ssbo_bindings =
rs->caps.caps.v2.host_feature_check_version >= 16
};
if (!(rs->caps.caps.v2.capability_bits_v2 & VIRGL_CAP_V2_TEXTURE_SHADOW_LOD) &&