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

Fix array removal for task/mesh in interface validation #5497

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions source/val/validate_interfaces.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,9 +311,15 @@ spv_result_t GetLocationsForVariable(
}
}

// Vulkan 14.1.3: Tessellation control and mesh per-vertex outputs and
// tessellation control, evaluation and geometry per-vertex inputs have a
// layer of arraying that is not included in interface matching.
// Vulkan 14.1.3: Some interfaces have a layer of arraying
// that is not included in interface matching:
// - Tessellation control input and output, except Patch decoration
// - Tessellation evaluation input, except Patch decoration
// - Geometry input
// - Fragment input with PerVertexKHR decoration
// - Task output, except PerTaskNV decoration
// - Mesh input, except PerTaskNV decoration
// - Mesh output
bool is_arrayed = false;
switch (entry_point->GetOperandAs<spv::ExecutionModel>(0)) {
case spv::ExecutionModel::TessellationControl:
Expand All @@ -336,11 +342,24 @@ spv_result_t GetLocationsForVariable(
is_arrayed = true;
}
break;
case spv::ExecutionModel::MeshNV:
case spv::ExecutionModel::TaskNV:
if (is_output && !has_per_task_nv) {
is_arrayed = true;
}
break;
case spv::ExecutionModel::TaskEXT:
if (is_output) {
is_arrayed = true;
}
break;
case spv::ExecutionModel::MeshNV:
if (is_output || !has_per_task_nv) {
is_arrayed = true;
}
break;
case spv::ExecutionModel::MeshEXT:
is_arrayed = true;
break;
default:
break;
}
Expand Down