Gfx: Invalid type long for attribute index expression.

Created on 7 Dec 2018  路  1Comment  路  Source: gfx-rs/gfx

Error:
error: invalid type \'long\' for attribute index expression\nfragment main0_out main0(main0_in in [[stage_in]], texture2d<float> colormap [[texture(4294967295)]], sampler colorsampler [[sampler(2)]])\n

  • GFX version: gfx-hal(41e96117203fcd55ba4b2168d6d3737a2f3ff541) metal
  • OS: MacOS
  • GPU: geforce 750m

Here is a gist of the code:
https://gist.github.com/Toasterthegamer/43a209c3598d2c0717c81fc65c877680

Sorry if the code is messy and in the wrong order. I had to pull it from a few different places. To fix the issue I used the correct binding order:

layout(set = 0, binding = 0) uniform texture2D colormap;
layout(set = 0, binding = 1) uniform sampler colorsampler;

The error message is confusing though.

Metal OSX bug low

Most helpful comment

I see what's going on. So the bindings of the shader didn't match the ones of the pipeline layout. Neither gfx-rs or any vulkan driver expect this, so strictly speaking this would be up to validation errors to prevent (and user cleverness, to an extent). However, I do agree that we could easily detect this in the backend (as an invalid case) and report as a clearer assertion or pipeline creation error, instead of showing obscure output of MSL compilation. Therefore, this isn't a blocker, lowering the priority.

>All comments

I see what's going on. So the bindings of the shader didn't match the ones of the pipeline layout. Neither gfx-rs or any vulkan driver expect this, so strictly speaking this would be up to validation errors to prevent (and user cleverness, to an extent). However, I do agree that we could easily detect this in the backend (as an invalid case) and report as a clearer assertion or pipeline creation error, instead of showing obscure output of MSL compilation. Therefore, this isn't a blocker, lowering the priority.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kvark picture kvark  路  3Comments

kvark picture kvark  路  3Comments

kvark picture kvark  路  5Comments

mjadczak picture mjadczak  路  4Comments

kvark picture kvark  路  5Comments