Skip to content

Latest commit

 

History

History
15 lines (9 loc) · 874 Bytes

README.md

File metadata and controls

15 lines (9 loc) · 874 Bytes

SCNShadableBug

Reproduce a bug with SNCShadable where the Metal shader code that gets generated has errors that make the shader fail.

The code works well on non Metal devices (simulator, iPhone 5c) but not on Metal devices (iPhone 6).

On the left: desire output, on the right: error Alt text

The code fails with error: redefinition of parameter 'u_diffuseTextureSampler'

u_diffuseTextureSampler is defined once here: https://github.com/gsabran/SCNShadableBug/blob/master/debug.log#L543

and gets defined a second time here https://github.com/gsabran/SCNShadableBug/blob/master/debug.log#L570 The second definition seems to come from the Metal compilation of the shader snippet that refers to u_diffuseTextureSampler but doens't define it.