From 78fc1197eba51c2b270ad6dbd0ba2e6ee336890c Mon Sep 17 00:00:00 2001 From: Jesse Natalie Date: Wed, 15 Mar 2023 09:59:10 -0700 Subject: [PATCH] microsoft/compiler: Handle writable buffer UAV size queries Part-of: --- src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt | 3 +-- src/microsoft/compiler/nir_to_dxil.c | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt b/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt index 4958d4a..3b14801 100644 --- a/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt +++ b/src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt @@ -48,9 +48,8 @@ spec@arb_sample_shading@arb_sample_shading-builtin-gl-sample-mask-mrt-alpha-to-c spec@arb_seamless_cube_map@arb_seamless_cubemap,Fail spec@arb_shader_atomic_counters@semantics,Fail spec@arb_shader_atomic_counters@semantics@Tessellation control shader atomic built-in semantics,Fail -spec@arb_shader_image_size@builtin,Crash -spec@arb_texture_buffer_object@texture-buffer-size-clamp,Crash spec@arb_texture_buffer_object@texture-buffer-size-clamp@r8ui_texture_buffer_size_via_sampler,Fail +spec@arb_texture_buffer_object@texture-buffer-size-clamp@r8ui_texture_buffer_size_via_image,Fail spec@arb_texture_buffer_range@ranges-2,Fail spec@arb_texture_buffer_range@ranges-2 compat,Fail spec@arb_texture_cube_map_array@arb_texture_cube_map_array-sampler-cube-array-shadow,Fail diff --git a/src/microsoft/compiler/nir_to_dxil.c b/src/microsoft/compiler/nir_to_dxil.c index 9edd4a7..178a1e8 100644 --- a/src/microsoft/compiler/nir_to_dxil.c +++ b/src/microsoft/compiler/nir_to_dxil.c @@ -4193,7 +4193,12 @@ emit_image_size(struct ntd_context *ctx, nir_intrinsic_instr *intr) if (!handle) return false; - const struct dxil_value *lod = get_src(ctx, &intr->src[1], 0, nir_type_uint); + enum glsl_sampler_dim sampler_dim = intr->intrinsic == nir_intrinsic_image_deref_size ? + glsl_get_sampler_dim(nir_src_as_deref(intr->src[0])->type) : + nir_intrinsic_image_dim(intr); + const struct dxil_value *lod = sampler_dim == GLSL_SAMPLER_DIM_BUF ? + dxil_module_get_undef(&ctx->mod, dxil_module_get_int_type(&ctx->mod, 32)) : + get_src(ctx, &intr->src[1], 0, nir_type_uint); if (!lod) return false; -- 2.7.4