microsoft/compiler: Handle writable buffer UAV size queries
authorJesse Natalie <jenatali@microsoft.com>
Wed, 15 Mar 2023 16:59:10 +0000 (09:59 -0700)
committerMarge Bot <emma+marge@anholt.net>
Thu, 23 Mar 2023 18:34:52 +0000 (18:34 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22093>

src/gallium/drivers/d3d12/ci/d3d12-quick_gl.txt
src/microsoft/compiler/nir_to_dxil.c

index 4958d4a..3b14801 100644 (file)
@@ -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
index 9edd4a7..178a1e8 100644 (file)
@@ -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;