Commit 62d010f9 by Shahbaz Youssefi Committed by Commit Bot

Vulkan: Assert that attributes in shader info map are active

Attributes that are not active shouldn't have made it to the ShaderInterfaceVariableInfoMap of gl::ShaderType::Vertex. This change turns a few ifs to ASSERT in SpirvVertexAttributeAliasingTransformer. Bug: angleproject:4249 Change-Id: I3da4ea773eae20fe2f126b82f7790e9f2cab0bc1 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2491929Reviewed-by: 's avatarCharlie Lao <cclao@google.com> Reviewed-by: 's avatarTim Van Patten <timvp@google.com> Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
parent e99b8bc0
...@@ -2227,13 +2227,13 @@ void SpirvVertexAttributeAliasingTransformer::preprocessAliasingAttributes() ...@@ -2227,13 +2227,13 @@ void SpirvVertexAttributeAliasingTransformer::preprocessAliasingAttributes()
{ {
const ShaderInterfaceVariableInfo *info = mVariableInfoById[id]; const ShaderInterfaceVariableInfo *info = mVariableInfoById[id];
// Ignore non attribute or inactive ids. // Ignore non attribute ids.
if (info == nullptr || info->attributeComponentCount == 0 || if (info == nullptr || info->attributeComponentCount == 0)
!info->activeStages[gl::ShaderType::Vertex])
{ {
continue; continue;
} }
ASSERT(info->activeStages[gl::ShaderType::Vertex]);
ASSERT(info->location != ShaderInterfaceVariableInfo::kInvalid); ASSERT(info->location != ShaderInterfaceVariableInfo::kInvalid);
const bool isMatrixAttribute = info->attributeLocationCount > 1; const bool isMatrixAttribute = info->attributeLocationCount > 1;
...@@ -3250,12 +3250,13 @@ bool HasAliasingAttributes(const ShaderInterfaceVariableInfoMap &variableInfoMap ...@@ -3250,12 +3250,13 @@ bool HasAliasingAttributes(const ShaderInterfaceVariableInfoMap &variableInfoMap
{ {
const ShaderInterfaceVariableInfo &info = infoIter.second; const ShaderInterfaceVariableInfo &info = infoIter.second;
// Ignore non attribute or inactive ids. // Ignore non attribute ids.
if (info.attributeComponentCount == 0 || !info.activeStages[gl::ShaderType::Vertex]) if (info.attributeComponentCount == 0)
{ {
continue; continue;
} }
ASSERT(info.activeStages[gl::ShaderType::Vertex]);
ASSERT(info.location != ShaderInterfaceVariableInfo::kInvalid); ASSERT(info.location != ShaderInterfaceVariableInfo::kInvalid);
ASSERT(info.attributeLocationCount > 0); ASSERT(info.attributeLocationCount > 0);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment