Search Issue Tracker
Fixed in 2021.3.26f1
Fixed in 2021.3.X, 2022.2.X, 2023.1.X, 2023.2.X, 2023.2.0a1
Votes
0
Found in
2020.3.44f1
2021.3.16f1
2022.2.2f1
2023.1.0a25
2023.2.0a1
Issue ID
UUM-22593
Regression
No
[Metal] Shader is broken when using SV_PrimitiveID
How to reproduce:
1. Open the attached project "Metal PrimitiveID Bug" and load Scene "ReproScene"
2. Observe the Scene
Expected result: The Shader of the Cube in the Scene appears as intended
Actual result: The Shader of the Cube is broken
Reproducible with: 2020.3.44f1, 2021.3.16f1, 2022.2.2f1, 2023.1.0a25
Reproduced on:
- MacOS (Intel) Editor
Notes:
- The issue does not reproduce when using OpenGLCore as the Graphics API
Comments (2)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- “Screen position out of view frustum...” errors are thrown when zooming out in the Scene view after creating UI GameObject
- CurveTexture is not being released when unloading AssetBundle containing a Scene with ColorCurves post-processing component in Global Volume
- Crash on ExtractActiveCasterInfo when navigating the scene view in a project with specific lighting data
- Build Profile name increments when numeric suffix is removed from duplicate Profile name
- "Unrecognized block header in profiler data file, stopping deserialization" error is shown and no more profiler data is recorded when the Player is connected and profiler recording is enabled/disabled few times
flyer19
Mar 06, 2024 05:42
using unity 2023.2.11f1
flyer19
Mar 06, 2024 05:40
DS_Output DS( HS_ConstantOutput HSConstantData,
const OutputPatch<HS_ControlPointOutput, 3> Input,
float3 BarycentricCoords : SV_DomainLocation,uint idTriangle : SV_PrimitiveID )
{
DS_Output Output = (DS_Output)0;
float fU = BarycentricCoords.x;
float fV = BarycentricCoords.y;
float fW = BarycentricCoords.z;
float3 pos = Input[0].pos * fU + Input[1].pos * fV + Input[2].pos * fW;
float2 uv=Input[0].uv * fU + Input[1].uv * fV + Input[2].uv * fW;
Output.uv=uv+idTriangle;
Output.pos = UnityObjectToClipPos (float4(pos.xyz,1.0));
return Output;
}
using idTriangle still not work