Skip to content

push constant range validation doesn't check for static usage #340

Closed
@jeffbolznv

Description

The CTS test dEQP-VK.pipeline.push_constant.graphics_pipeline.overlap_2_shaders_vert_frag (and a few similarly named tests) generate validation errors like:

ERROR:  [ UNASSIGNED-CoreValidation-Shader-PushConstantNotAccessibleFromStage ] Object: VK_NULL_HANDLE (Type = 0) | Push constant range covering variable starting at offset 12 not accessible from stage VK_SHADER_STAGE_FRAGMENT_BIT (code 0xffffffff from Validation at Unknown:0)

The fragment shader is:

#version 450
layout(location = 0) in highp vec4 vtxColor;
layout(location = 0) out highp vec4 fragColor;
layout(push_constant) uniform Material
{
    layout(offset = 12) int dummy1;
    layout(offset = 16) vec4 dummy2;
    layout(offset = 32) vec4 color;
} matInst;
void main (void)
{
    fragColor = vtxColor;
    fragColor += matInst.color;
    fragColor = min(mod(fragColor, 2.0), 2.0 - mod(fragColor, 2.0));
}

which doesn't statically use dummy1. It looks like MarkAccessibleIds is supposed to handle static usage, but I guess it probably isn't digging down into the structure's members.

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions