2

I want to use an array of vec3 in my Vertex shader. I created

layout(binding = 1) readonly buffer MyBuffer {
   vec3 buf[];
} myBuffer;
...
vec test = myBuffer[gl_VertexIndex];

layout in my GLSL and glslc it over to my SPIR-V where it has it's NonWriteable op-code. I did all the CPU side work setting it up with a descriptor set and all. It seems that the data is getting through correctly, but I get this warning through the validation layer

ERROR: [Validation] Code 15 : Object: VK_NULL_HANDLE (Type = 0) | Shader requires vertexPipelineStoresAndAtomics but is not enabled on the device

Which then looking more into it, I realize the vertexPipelineStoresAndAtomics is just for non-compute shaders to write to, but I am only ever reading the data so not sure why it is yelling at me. Also it seems like it is still working so is this a false negative error or am I doing something completely wrong?

FrickeFresh
  • 1,688
  • 1
  • 19
  • 31
  • 1
    From the spec: "vertexPipelineStoresAndAtomics [...] If this feature is not enabled, all storage image, storage texel buffers, and storage buffer variables used by these stages in shader modules must be decorated with the NonWriteable decoration (or the readonly memory qualifier in GLSL)." You provide `readonly` qualifier, so if You also set everything else correctly, than this is probably a bug in validation layers. – Ekzuzy May 11 '18 at 12:33

1 Answers1

2

This is currently an actively tracked bug in the validation suite. See https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/2526 for more information.

jeremyong
  • 445
  • 4
  • 15