Why is writing to a buffer from within a fragment shader disallowed in Metal?

后端 未结 2 1143
醉酒成梦
醉酒成梦 2021-02-05 02:47

As stated in the Metal Shading Language Guide:

Writes to a buffer or a texture are disallowed from a fragment function.

I understand tha

2条回答
  •  终归单人心
    2021-02-05 03:19

    Writes to buffers from fragment shaders is now supported, as mentioned in What’s New in iOS 10, tvOS 10, and macOS 10.12

    Function Buffer Read-Writes Available in: iOS_GPUFamily3_v2, OSX_GPUFamily1_v2

    Fragment functions can now write to buffers. Writable buffers must be declared in the device address space and must not be const. Use dynamic indexing to write to a buffer.

    More over, line specifying the restriction (from the original question) is not there in Metal Shading Language Specification 2.0

提交回复
热议问题