Skip to content
This repository has been archived by the owner on Jul 19, 2018. It is now read-only.

No warning before a crash if pipeline layout has _no_ descriptor sets, but the shader declares uniform inputs #2624

Open
jherico opened this issue Apr 30, 2018 · 1 comment
Assignees

Comments

@jherico
Copy link

jherico commented Apr 30, 2018

I'm working on a shader where the inputs are declared like so:


layout (location = 0) in vec4 inPos;

layout (binding = 0) uniform Camera {
    mat4 projection;
    mat4 view;
} camera;

layout(push_constant) uniform PushConsts {
    mat4 orientation;
    vec4 color;
} pushConsts;

currently my pipeline layout creation code looks like this:

vk::PushConstantRange pushConstantRange{ vk::ShaderStageFlagBits::eVertex, 0, sizeof(SkyGrids::PushContstants) };
_skyGrids.pipelineLayout = _device.createPipelineLayout({ {}, 0, nullptr, 1, &pushConstantRange });

If I comment out the camera uniform block in the inputs of my shader, my pipeline gets created just fine. However, if I leave it there, when I try to create a pipeline I get an initialization error back, but no validation message beforehand.

Should not the validation layers be able to detect that you're attempting to create a shader that requires a descriptor set, when you've supplied none in the pipeline layout?

@chrisforbes
Copy link
Collaborator

Yes, we should be detecting this case.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants