Commit d073d8eb by Ben Clayton Committed by Ben Clayton

SpirvShader: Add support for DescriptorSet and Binding decorations

Bug: b/126330097 Change-Id: Id705dc19bb3a114bf703ddc37b529d6ac89b4d52 Reviewed-on: https://swiftshader-review.googlesource.com/c/25549Reviewed-by: 's avatarChris Forbes <chrisforbes@google.com> Tested-by: 's avatarBen Clayton <bclayton@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 24ea5159
......@@ -656,6 +656,14 @@ namespace sw
HasComponent = true;
Component = arg;
break;
case spv::DecorationDescriptorSet:
HasDescriptorSet = true;
DescriptorSet = arg;
break;
case spv::DecorationBinding:
HasBinding = true;
Binding = arg;
break;
case spv::DecorationBuiltIn:
HasBuiltIn = true;
BuiltIn = static_cast<spv::BuiltIn>(arg);
......@@ -702,6 +710,18 @@ namespace sw
Component = src.Component;
}
if (src.HasDescriptorSet)
{
HasDescriptorSet = true;
DescriptorSet = src.DescriptorSet;
}
if (src.HasBinding)
{
HasBinding = true;
Binding = src.Binding;
}
Flat |= src.Flat;
NoPerspective |= src.NoPerspective;
Centroid |= src.Centroid;
......
......@@ -271,9 +271,13 @@ namespace sw
{
int32_t Location;
int32_t Component;
int32_t DescriptorSet;
int32_t Binding;
spv::BuiltIn BuiltIn;
bool HasLocation : 1;
bool HasComponent : 1;
bool HasDescriptorSet : 1;
bool HasBinding : 1;
bool HasBuiltIn : 1;
bool Flat : 1;
bool Centroid : 1;
......@@ -282,10 +286,12 @@ namespace sw
bool BufferBlock : 1;
Decorations()
: Location{-1}, Component{0}, BuiltIn{}, HasLocation{false}, HasComponent{false}, HasBuiltIn{false},
Flat{false},
Centroid{false}, NoPerspective{false}, Block{false},
BufferBlock{false}
: Location{-1}, Component{0}, DescriptorSet{-1}, Binding{-1},
BuiltIn{static_cast<spv::BuiltIn>(-1)},
HasLocation{false}, HasComponent{false},
HasDescriptorSet{false}, HasBinding{false},
HasBuiltIn{false}, Flat{false}, Centroid{false},
NoPerspective{false}, Block{false}, BufferBlock{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