HLSL: allow name mangling based on texture template type

Name mangling did not account for the vector size in the template type of a texture.
This adds that.  The mangle is as it ever was for the vec4 case, which leaves
all GLSL behavior and most HLSL behavior uneffected.  For vec1-3 the size is added
to the mangle.

Current limitation: textures cannot presently be templatized on structured types,
so this works only for vectors of basic types.

Fixes #895.
This commit is contained in:
LoopDawg
2017-05-18 17:43:08 -06:00
parent ab0847ef01
commit 132a28aac4
4 changed files with 254 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
Texture2D<float> tf1;
Texture2D<float4> tf4;
RWTexture2D<float> twf1;
RWTexture2D<float4> twf4;
float Func(Texture2D<float> DummyTex) { return 1.0f; }
float4 Func(Texture2D<float4> DummyTex) { return float4(0,0,0,0); }
float Func(RWTexture2D<float> DummyTex) { return 1.0f; }
float4 Func(RWTexture2D<float4> DummyTex) { return float4(0,0,0,0); }
float4 main() : SV_TARGET
{
return Func(tf1) + Func(tf4) + Func(twf1) + Func(twf4);
}