Skip to content

Commit a04ede8

Browse files
rolandk-unityEvergreen
authored andcommitted
Added a dummy field to UnityTexture3D to work around https://jira.uni…
1 parent cf066cf commit a04ede8

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
@@ -155,6 +155,12 @@ struct UnityTexture3D
155155
TEXTURE3D(tex);
156156
SAMPLER(samplerstate);
157157

158+
// 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
159+
// Without this additional field, UnityTexture3D and sampler3D_f have the exact same structure, which will cause DXC to consider
160+
// them as the same type. This causes to compilation errors due to the corresponding overloads of tex3D being considered ambiguous
161+
// by DXC. Adding the field resolves this. Starting from Unity 6.5, the field is actually used in code.
162+
float4 hdrDecode;
163+
158164
// these functions allows users to convert code using Texture3D to UnityTexture3D by simply changing the type of the variable
159165
// the existing texture macros will call these functions, which will forward the call to the texture appropriately
160166
float4 Sample(UnitySamplerState s, float3 uvw) { return SAMPLE_TEXTURE3D(tex, s.samplerstate, uvw); }

0 commit comments

Comments
 (0)