Fix Test/hlsl.namespace.frag test case

Before this change, the example is rejected by DXC:

$ dxc -T ps_6_0 hlsl.namespace.frag
hlsl.namespace.frag:22:73: error: call to non-static member function
without an object argument
    return N1::getVec() + N2::getVec() + N2::N3::getVec() + N2::N3::C1::getVec() * N2::gf;
                                                                ~~~~~~~~~~~~^~~~~~

The call to the class member function requires an object, or we ned to
make the function static.  This update makes the function static.

This also fixes SPIR-V validation: without this change the call
to that getVec does not have enough arguments:

error: line 69: OpFunctionCall Function <id>'s parameter count does not
match the argument count.
  %43 = OpFunctionCall %v4float %N2__N3__C1__getVec_
This commit is contained in:
David Neto
2022-02-16 17:10:29 -05:00
parent 90d4bd05cd
commit 63dbacaa94
2 changed files with 45 additions and 54 deletions

View File

@@ -12,7 +12,7 @@ namespace N2 {
float4 getVec() { return v2; }
class C1 {
float4 getVec() { return v2; }
static float4 getVec() { return v2; }
};
}
}