Hi all,
I don't understand the error:
What am I doing wrong:
The shader function header looks like this:
MyParams is a struct of several floats and simd_float4 (because it seems that I can't use metal's float4 in a C++/Objective-C file. Texture has RenderTarget, ShaderRead and ShaderWrite usage.
Note, that this code seems to have worked in another project, but here it throws this error.
Any help appreciated.
I don't understand the error:
Does this error pertain to textures or to buffers?validateFunctionArguments:3487: failed assertion `Fragment Function(MyFunction): Bytes are being bound at index 0 to a shader argument with write access enabled.
What am I doing wrong:
Code Block // set input texture [commandEncoder setFragmentTexture:srcTexture atIndex:0]; // set params [commandEncoder setFragmentBytes:¶ms length:sizeof(params) atIndex:0]; [commandEncoder drawPrimitives:MTLPrimitiveTypeTriangleStrip vertexStart:0 vertexCount:4];
The shader function header looks like this:
Code Block fragment float4 MyFunction(RasterizerData in [[ stage_in ]], device MyParams& params [[ buffer (0) ]], texture2d<half, access::sample> src [[ texture(0) ]])
MyParams is a struct of several floats and simd_float4 (because it seems that I can't use metal's float4 in a C++/Objective-C file. Texture has RenderTarget, ShaderRead and ShaderWrite usage.
Note, that this code seems to have worked in another project, but here it throws this error.
Any help appreciated.