HLSL default function parameters
This PR adds support for default function parameters in the following cases:
1. Simple constants, such as void fn(int x, float myparam = 3)
2. Expressions that can be const folded, such a ... myparam = sin(some_const)
3. Initializer lists that can be const folded, such as ... float2 myparam = {1,2}
New tests are added: hlsl.params.default.frag and hlsl.params.default.err.frag
(for testing error situations, such as ambiguity or non-const-foldable).
In order to avoid sampler method ambiguity, the hlsl better() lambda now
considers sampler matches. Previously, all sampler types looked identical
since only the basic type of EbtSampler was considered.
This commit is contained in:
parent
807a0d9e2f
commit
26d3145334
15 changed files with 1263 additions and 24 deletions
|
|
@ -586,7 +586,7 @@ void TBuiltInParseablesHlsl::initialize(int /*version*/, EProfile /*profile*/, c
|
|||
{ "DeviceMemoryBarrier", nullptr, nullptr, "-", "-", EShLangPSCS },
|
||||
{ "DeviceMemoryBarrierWithGroupSync", nullptr, nullptr, "-", "-", EShLangCS },
|
||||
{ "distance", "S", "F", "V,", "F,", EShLangAll },
|
||||
{ "dot", "S", nullptr, "V,", "FI,", EShLangAll },
|
||||
{ "dot", "S", nullptr, "SV,", "FI,", EShLangAll },
|
||||
{ "dst", nullptr, nullptr, "V4,", "F,", EShLangAll },
|
||||
// { "errorf", "-", "-", "", "", EShLangAll }, TODO: varargs
|
||||
{ "EvaluateAttributeAtCentroid", nullptr, nullptr, "SVM", "F", EShLangPS },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue