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
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
- Search field in UI Builder's Library has no character limit
- Changing the value in UI Builder by dragging increases it by a few thousand points when reaching the borders of the screen
- ARM64 architecture DLL incorrectly copied instead of x64 when building for Windows x64
- Crash on TypeTreeIterator::GetNode when opening a specific folder
- Crash on WriteSerializedAssetsV2 when (re)entering the Play Mode in a specific project when IEnumerator Start() is used
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