Search Issue Tracker

Fixed in 2017.2.0f3

Votes

0

Found in

2017.1.0f1

Issue ID

926975

Regression

No

[Metal] Unable to access Texture2DArray from compute shader

Graphics - General

-

Reproduction steps:
1. Open the attached project.
2. Make sure Editor is running with Metal graphics API.
3. Play and stop the scene.
- Metal runtime fails to compile a compute shader that accesses a Texture2DArray
4. Open the Editor log.
- The following compilation error can be found in the Editor log.

...
Compilation failed:

<program source>:12:18: error: no matching member function for call to 'write'
TextureArray.write(u_xlat0, mtl_ThreadID.xyz);
~~~~~~~~~~~~~^~~~~
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/A/lib/clang/3.5/include/metal/metal_texture:1026:21: note: candidate function not viable: requires at least 3 arguments, but 2 were provided
METAL_FUNC void write(vec<T,4> color, uint2 coord, uint array, uint lod = 0) METAL_VALID_LOD_ARG(lod) {
^
/System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/A/lib/clang/3.5/include/metal/metal_texture:1035:21: note: candidate function not viable: requires at least 3 arguments, but 2 were provided
METAL_FUNC void write(vec<T,4> color, ushort2 coord, ushort array, ushort lod = 0) METAL_VALID_LOD_ARG(lod) {
^

#include <metal_stdlib>
#include <metal_texture>
using namespace metal;
kernel void computeMain(
texture2d_array<float, access::write > TextureArray [[ texture (0) ]] ,
uint3 mtl_ThreadID [[ thread_position_in_grid ]])
{
float4 u_xlat0;
u_xlat0.xyz = float3(mtl_ThreadID.xyz);
u_xlat0.xyz = u_xlat0.xyz * float3(0.125, 0.125, 0.125);
u_xlat0.w = 0.0;
TextureArray.write(u_xlat0, mtl_ThreadID.xyz);
return;
}
Metal: Failed to create compute library
...

Reproduced with:
5.6.0f1, 2017.2.0b2
Metal

Not reproducible with:
OpenGL

Comments (3)

  1. 18830f842f32881b79cae9d33351f107?d=mm

    Lars-Steenhoff

    Dec 06, 2017 15:55

    backport fix to 5.6?

  2. 1c9f4b26829f34c14066260b1ba8316e?d=mm

    kristoof

    Nov 27, 2017 14:40

    Nop, still there

  3. 8a307483f0194e610886286350ca47d2?d=mm

    MrChromaroid

    Sep 24, 2017 14:29

    Is this fix included in 2017.2.0 f1?

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.