gfx-rs/wgpu-rs

Validation error when using SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING under Vulkan

Closed this issue · 3 comments

When using texture array's with non-uniform indexing under wgpu master:

#version 450
#extension GL_EXT_nonuniform_qualifier : require

layout(location = 0) flat in uint v_tile_index;
layout(location = 1) in vec2 v_tex_coord;
layout(location = 0) out vec4 f_color;
layout(set = 1, binding = 0) uniform texture2D t_tiles[];
layout(set = 1, binding = 1) uniform sampler s_tiles;

void main() {
    f_color = texture(sampler2D(t_tiles[nonuniformEXT(v_tile_index)], s_tiles), v_tex_coord);
}

And defining the following features:

features: wgpu::Features::
      wgpu::Features::SAMPLED_TEXTURE_BINDING_ARRAY
    | wgpu::Features::SAMPLED_TEXTURE_ARRAY_DYNAMIC_INDEXING
    | wgpu::Features::SAMPLED_TEXTURE_ARRAY_NON_UNIFORM_INDEXING
    | wgpu::Features::UNSIZED_BINDING_ARRAY,

I get the following validation error when using the Vulkan backend:

VALIDATION [UNASSIGNED-CoreValidation-Shader-FeatureNotEnabled (-1940616195)] :
Validation Error: [ UNASSIGNED-CoreValidation-Shader-FeatureNotEnabled ] 
Object 0: handle = 0x1a0d46f7b18, type = VK_OBJECT_TYPE_DEVICE;
| MessageID = 0x8c548bfd | 
Shader requires extension VK_EXT_descriptor_indexing but is not enabled on the device
object info: (type: DEVICE, hndl: 1790270470936)

The shader works as expected otherwise and the non-uniform access seems to work as expected.

kvark commented

I'm seeing the same problem on texture-array example in wgpu-rs. cc @cwfitzgerald

Can reproduce, investigating...

Fixed using the current master.