Commit 8448cc5b by Ben Clayton

SpirvShader: Handle DecorationRelaxedPrecision decorations

While not strictly necessary (we could always calculate with the highest precision), it is a tiny amount of work to dramatically increase performance of instructions like InverseSqrt for relaxed precision types. Bug: b/126873455 Change-Id: I42d5871a8e0886001e85fd4e16f8e6cb309236cf Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/28696Tested-by: 's avatarBen Clayton <bclayton@google.com> Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com> Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
parent 6517ad2f
......@@ -1133,6 +1133,9 @@ namespace sw
HasMatrixStride = true;
MatrixStride = static_cast<int32_t>(arg);
break;
case spv::DecorationRelaxedPrecision:
RelaxedPrecision = true;
break;
default:
// Intentionally partial, there are many decorations we just don't care about.
break;
......@@ -1195,6 +1198,7 @@ namespace sw
Centroid |= src.Centroid;
Block |= src.Block;
BufferBlock |= src.BufferBlock;
RelaxedPrecision |= src.RelaxedPrecision;
}
void SpirvShader::ApplyDecorationsForId(Decorations *d, TypeOrObjectID id) const
......
......@@ -422,6 +422,7 @@ namespace sw
bool HasOffset : 1;
bool HasArrayStride : 1;
bool HasMatrixStride : 1;
bool RelaxedPrecision : 1;
Decorations()
: Location{-1}, Component{0}, DescriptorSet{-1}, Binding{-1},
......@@ -431,7 +432,8 @@ namespace sw
HasDescriptorSet{false}, HasBinding{false},
HasBuiltIn{false}, Flat{false}, Centroid{false},
NoPerspective{false}, Block{false}, BufferBlock{false},
HasOffset{false}, HasArrayStride{false}, HasMatrixStride{false}
HasOffset{false}, HasArrayStride{false}, HasMatrixStride{false},
RelaxedPrecision{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