Shader converter: gl_FragDepth and sampler arrays


This topic contains 4 replies, has 2 voices, and was last updated by  Bill Hollings 1 year, 5 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1272

    skalarproduktraum
    Participant

    Hello MoltenVK team!

    First, huge thumbs up for your effort in bringing Vulkan to the Apple ecosystem!

    Second, I’m having two slight issues with my shaders, and I’m wondering whether these are issues with your shader converter, or whether I need to change something:

    1. The shader converter does not seem to be aware of gl_FragDepth,

    
    <program source>:201:9: error: use of undeclared identifier 'gl_FragDepth'
            gl_FragDepth = Depth;
    

    2. The shader converter also does not seem to be aware of sampler arrays:

    
    <program source>:51:33: error: type 'texture2d<float>' does not provide a subscript operator
            diffuse = ObjectTextures[1].sample(ObjectTextures[1]Smplr, in.VertexData_TexCoord).xyz;
    

    Looking forward to your advise 🙂

    #1273

    Bill Hollings
    Keymaster

    @skalarproduktraum

    Thanks for identifying the issue with gl_FragDepth. It is indeed not behaving correctly. We have fixed this now…and it will appear in the next release of MoltenVK.

    Sampler arrays are new in Metal2 and support for them has not yet been added to MoltenVK. Please look for it later in the year.

    …Bill

    #1276

    skalarproduktraum
    Participant

    Hey Bill,

    thanks for the answer! I guess I’ll use separate samplers instead of an array then.
    Any ETA for both the next release and sampler arrays?

    #1277

    skalarproduktraum
    Participant

    Actually, wouldn’t it be easier to convert sampler arrays to a series of single samplers? That’d probably also work then on non-Metal2 OSX’s.

    #1288

    Bill Hollings
    Keymaster

    @skalarproduktraum

    Support for gl_FragDepth is now available.

    Thanks for your suggestion about breaking a sampler array into individual components. We’ll look into that for backward compatibility when we implement the feature. There might be issues with shader conversion from SPIR-V though.

    …Bill

Viewing 5 posts - 1 through 5 (of 5 total)

The forum ‘MoltenVK Support’ is closed to new topics and replies.