Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update location/component conflict validation #5993

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alan-baker
Copy link
Contributor

Refs #5989

  • Update input/output interface validation to treat arrays and matrices as consuming all 4 components in each location

This handles the removal of interleaving components among array/matrix elements.

Refs KhronosGroup#5989

* Update input/output interface validation to treat arrays and matrices
  as consuming all 4 components in each location
@alan-baker
Copy link
Contributor Author

I expect this will break some glslang tests because this is allowed (and tested) in glslang.

* For arrays and matrices make `NumConsumedComponents` more consistent
  * calculate per element components and round up to a multiple of 4
@spencer-lunarg
Copy link
Contributor

spencer-lunarg commented Feb 16, 2025

According to the Vulkan Guide article the following GLSL is banned

layout(location=0, component = 1) in float a[3];

because array must not have a component decoration (with the stage exceptions inVUID-StandaloneSpirv-Execution-10584/ VUID-StandaloneSpirv-Execution-10585)

so checking, this change doesn't throw an error for

           OpCapability Shader
           OpMemoryModel Logical GLSL450
           OpEntryPoint Vertex %main "main" %x
           OpDecorate %x Location 0
           OpDecorate %x Component 1
   %void = OpTypeVoid
      %4 = OpTypeFunction %void
   %uint = OpTypeInt 32 0
 %uint_2 = OpConstant %uint 2
%t_array = OpTypeArray %uint %uint_2
    %ptr = OpTypePointer Input %t_array
      %x = OpVariable %ptr Input
   %main = OpFunction %void None %4
      %6 = OpLabel
           OpReturn
           OpFunctionEnd

@alan-baker
Copy link
Contributor Author

Those VUs say no arrays of arrays. That example is a single level of array. I think there might be missing VUs to ban that example. I had raised vulkan internal issue 4180 for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In progress
Development

Successfully merging this pull request may close these issues.

2 participants