Skip to content

Commit 9012b23

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.0] Added a dummy field to UnityTexture3D to work around https://jira.uni…
1 parent ae76298 commit 9012b23

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • Packages/com.unity.render-pipelines.core/ShaderLibrary

Packages/com.unity.render-pipelines.core/ShaderLibrary/Texture.hlsl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,12 @@ struct UnityTexture3D
143143
TEXTURE3D(tex);
144144
SAMPLER(samplerstate);
145145

146+
// This dummy field is unused in Unity 6.4 and earlier. Here, the field is added strictly as a dummy to work around UUM-133088
147+
// Without this additional field, UnityTexture3D and sampler3D_f have the exact same structure, which will cause DXC to consider
148+
// them as the same type. This causes to compilation errors due to the corresponding overloads of tex3D being considered ambiguous
149+
// by DXC. Adding the field resolves this. Starting from Unity 6.5, the field is actually used in code.
150+
float4 hdrDecode;
151+
146152
// these functions allows users to convert code using Texture3D to UnityTexture3D by simply changing the type of the variable
147153
// the existing texture macros will call these functions, which will forward the call to the texture appropriately
148154
float4 Sample(UnitySamplerState s, float3 uvw) { return SAMPLE_TEXTURE3D(tex, s.samplerstate, uvw); }

0 commit comments

Comments
 (0)