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 ...@@ -656,6 +656,14 @@ namespace sw
HasComponent = true; HasComponent = true;
Component = arg; Component = arg;
break; break;
case spv::DecorationDescriptorSet:
HasDescriptorSet = true;
DescriptorSet = arg;
break;
case spv::DecorationBinding:
HasBinding = true;
Binding = arg;
break;
case spv::DecorationBuiltIn: case spv::DecorationBuiltIn:
HasBuiltIn = true; HasBuiltIn = true;
BuiltIn = static_cast<spv::BuiltIn>(arg); BuiltIn = static_cast<spv::BuiltIn>(arg);
...@@ -702,6 +710,18 @@ namespace sw ...@@ -702,6 +710,18 @@ namespace sw
Component = src.Component; Component = src.Component;
} }
if (src.HasDescriptorSet)
{
HasDescriptorSet = true;
DescriptorSet = src.DescriptorSet;
}
if (src.HasBinding)
{
HasBinding = true;
Binding = src.Binding;
}
Flat |= src.Flat; Flat |= src.Flat;
NoPerspective |= src.NoPerspective; NoPerspective |= src.NoPerspective;
Centroid |= src.Centroid; Centroid |= src.Centroid;
......
...@@ -271,9 +271,13 @@ namespace sw ...@@ -271,9 +271,13 @@ namespace sw
{ {
int32_t Location; int32_t Location;
int32_t Component; int32_t Component;
int32_t DescriptorSet;
int32_t Binding;
spv::BuiltIn BuiltIn; spv::BuiltIn BuiltIn;
bool HasLocation : 1; bool HasLocation : 1;
bool HasComponent : 1; bool HasComponent : 1;
bool HasDescriptorSet : 1;
bool HasBinding : 1;
bool HasBuiltIn : 1; bool HasBuiltIn : 1;
bool Flat : 1; bool Flat : 1;
bool Centroid : 1; bool Centroid : 1;
...@@ -282,10 +286,12 @@ namespace sw ...@@ -282,10 +286,12 @@ namespace sw
bool BufferBlock : 1; bool BufferBlock : 1;
Decorations() Decorations()
: Location{-1}, Component{0}, BuiltIn{}, HasLocation{false}, HasComponent{false}, HasBuiltIn{false}, : Location{-1}, Component{0}, DescriptorSet{-1}, Binding{-1},
Flat{false}, BuiltIn{static_cast<spv::BuiltIn>(-1)},
Centroid{false}, NoPerspective{false}, Block{false}, HasLocation{false}, HasComponent{false},
BufferBlock{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