Search Issue Tracker
Fixed
Fixed in 2021.3.26f1, 2022.2.7f1, 2023.1.0b2, 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
- Sprite Atlas Asset UI issues
- Palette Settings link to the documentation isn’t working
- "Type Options" and "Node Library" dropdowns do not open when clicked on the title
- Public char variables uneditable in Inspector when project setting "Use IMGUI Default Inspector" is enabled
- IAP Listener component’s list titles go out of bounds when resizing the Inspector window horizontally
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