Skip to content

layers: Validate Clip/Cull array size - #13002

Open
spencer-lunarg wants to merge 1 commit into
KhronosGroup:mainfrom
spencer-lunarg:spencer-lunarg-procrastinating-so-hard-i-decided-to-finally-handle-cull-and-clip-and-i-forgot-how-ugly-this-was
Open

layers: Validate Clip/Cull array size#13002
spencer-lunarg wants to merge 1 commit into
KhronosGroup:mainfrom
spencer-lunarg:spencer-lunarg-procrastinating-so-hard-i-decided-to-finally-handle-cull-and-clip-and-i-forgot-how-ugly-this-was

Conversation

@spencer-lunarg

Copy link
Copy Markdown
Contributor

closes #6801

6 years ago I tried #1950 and knew nothing, now I am WAY to deep into the SPIR-V code... this check still sucks, but having all the tools/helpers in place to do still feels like a "win" to me... time to call it a week 🙃

@spencer-lunarg
spencer-lunarg requested a review from a team as a code owner September 4, 2026 21:40
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 105783.

}

// ClipDistance/CullDistance can show up as both a top-level array variable and a member of a Block-decorated struct
// Geo/Tess might be wrapped in an extra array (ex. gl_in[] / gl_out[]) which is already stripped out

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decided if CTS passes with validation, that is all I care about for Geo/Tess at this point

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24349 running.

@spencer-lunarg
spencer-lunarg force-pushed the spencer-lunarg-procrastinating-so-hard-i-decided-to-finally-handle-cull-and-clip-and-i-forgot-how-ugly-this-was branch from 149a819 to a6afa0d Compare September 4, 2026 23:14
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 106004.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24350 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24350 failed.

@spencer-lunarg
spencer-lunarg force-pushed the spencer-lunarg-procrastinating-so-hard-i-decided-to-finally-handle-cull-and-clip-and-i-forgot-how-ugly-this-was branch from a6afa0d to b07571f Compare September 5, 2026 12:10
@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build queued with queue ID 106736.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24353 running.

@ci-tester-lunarg

Copy link
Copy Markdown
Collaborator

CI Vulkan-ValidationLayers build # 24353 passed.

const uint32_t array_size = max_clip_distances + 1;

// layout(location = 0) out vec4 uFragColor;
// in float gl_ClipDistance[]; // array_size elements

@artem-lunarg artem-lunarg Sep 7, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I remember used gl_ClipDistance to render quake 3 maps, good memories. It was long time ago, but it's better later than never, thanks for the fix!

@spencer-lunarg

Copy link
Copy Markdown
Contributor Author

currently waiting on https://gitlab.khronos.org/vulkan/vulkan/-/work_items/4965 - seems might need to adjust this logic with the WG results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Shader Built-in Array Limit

3 participants