Commit 65321071 by Chris Forbes

Collect Offset,MatrixStride,ArrayStride decorations

These decorations are used for all explicit layout storage classes -- Uniform, StorageBuffer, PushConstant. Bug: b/120799499 Change-Id: Ida7ee6e2a5145d09792acf39b6e33d039431578b Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/26489Reviewed-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Tested-by: 's avatarChris Forbes <chrisforbes@google.com> Presubmit-Ready: Chris Forbes <chrisforbes@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent f3a430d1
...@@ -812,6 +812,18 @@ namespace sw ...@@ -812,6 +812,18 @@ namespace sw
case spv::DecorationBufferBlock: case spv::DecorationBufferBlock:
BufferBlock = true; BufferBlock = true;
break; break;
case spv::DecorationOffset:
HasOffset = true;
Offset = static_cast<int32_t>(arg);
break;
case spv::DecorationArrayStride:
HasArrayStride = true;
ArrayStride = static_cast<int32_t>(arg);
break;
case spv::DecorationMatrixStride:
HasMatrixStride = true;
MatrixStride = static_cast<int32_t>(arg);
break;
default: default:
// Intentionally partial, there are many decorations we just don't care about. // Intentionally partial, there are many decorations we just don't care about.
break; break;
...@@ -851,6 +863,24 @@ namespace sw ...@@ -851,6 +863,24 @@ namespace sw
Binding = src.Binding; Binding = src.Binding;
} }
if (src.HasOffset)
{
HasOffset = true;
Offset = src.Offset;
}
if (src.HasArrayStride)
{
HasArrayStride = true;
ArrayStride = src.ArrayStride;
}
if (src.HasMatrixStride)
{
HasMatrixStride = true;
MatrixStride = src.MatrixStride;
}
Flat |= src.Flat; Flat |= src.Flat;
NoPerspective |= src.NoPerspective; NoPerspective |= src.NoPerspective;
Centroid |= src.Centroid; Centroid |= src.Centroid;
......
...@@ -292,6 +292,9 @@ namespace sw ...@@ -292,6 +292,9 @@ namespace sw
int32_t DescriptorSet; int32_t DescriptorSet;
int32_t Binding; int32_t Binding;
spv::BuiltIn BuiltIn; spv::BuiltIn BuiltIn;
int32_t Offset;
int32_t ArrayStride;
int32_t MatrixStride;
bool HasLocation : 1; bool HasLocation : 1;
bool HasComponent : 1; bool HasComponent : 1;
bool HasDescriptorSet : 1; bool HasDescriptorSet : 1;
...@@ -302,14 +305,19 @@ namespace sw ...@@ -302,14 +305,19 @@ namespace sw
bool NoPerspective : 1; bool NoPerspective : 1;
bool Block : 1; bool Block : 1;
bool BufferBlock : 1; bool BufferBlock : 1;
bool HasOffset : 1;
bool HasArrayStride : 1;
bool HasMatrixStride : 1;
Decorations() Decorations()
: Location{-1}, Component{0}, DescriptorSet{-1}, Binding{-1}, : Location{-1}, Component{0}, DescriptorSet{-1}, Binding{-1},
BuiltIn{static_cast<spv::BuiltIn>(-1)}, BuiltIn{static_cast<spv::BuiltIn>(-1)},
Offset{-1}, ArrayStride{-1}, MatrixStride{-1},
HasLocation{false}, HasComponent{false}, HasLocation{false}, HasComponent{false},
HasDescriptorSet{false}, HasBinding{false}, HasDescriptorSet{false}, HasBinding{false},
HasBuiltIn{false}, Flat{false}, Centroid{false}, HasBuiltIn{false}, Flat{false}, Centroid{false},
NoPerspective{false}, Block{false}, BufferBlock{false} NoPerspective{false}, Block{false}, BufferBlock{false},
HasOffset{false}, HasArrayStride{false}, HasMatrixStride{false}
{ {
} }
......
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