Search Issue Tracker

Won't Fix

Votes

0

Found in

2018.2.0f2

Issue ID

1059656

Regression

No

[Metal] Shader output shows corrupted textures

Graphics - General

-

Reproduction steps:
1. Open the attached project (ECSSample00.zip).
2. Play the 'main' scene.
- Notice a texture shape.
3. Open the "Shaders/sprite_instanced.shader" file.
4. Comment line 65: float2 uv = float2((vid&0x1) == 0 ? uv0.x : uv0.z, (vid/0x2) == 0 ? uv0.y : uv0.w)
5. Uncomment line 64: float2 uv = float2((vid&0x1) == 0 ? uv0.x : uv0.z, (vid/2) == 0 ? uv0.y : uv0.w);
6. Play the main scene again.

Actual behavior (Screenshots attached):
- Texture shape gets corrupted.

Reproduced with:
2018.1.1f1, 2018.1.9f1, 2018.2.3f1, 2018.3.0a8

Note:
Couldn't test with OpenGL: "-------- GLSL link error: ERROR: Implementation limit of 4096 (e.g., number of built-in plus user defined active uniforms components) exceeded, vertex shader uses 12300 total uniforms."

  1. Resolution Note:

    This is "HLSL" compiler issue (not in our pipeline). The "fix" is easy - just use vertexid as *uint* as it should be, otherwise HLSL compiler adds some weird code to do signed division (why 0x2 works - i guess it is treated as unsigned, at least unsigned ops are generated)

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.