AnsweredAssumed Answered

SPIR-V shader on AMD GPU

Question asked by marzRX on Jun 1, 2020

I tried latest AMD gpu driver. But my SPIR-V program doesn't work.

 

fbo_ubo:
This program use uniform block object. SPIR-V route doesn't work correctly.
I think GPU can not receive the data of uniform block. It seems that the data in the uniform block is all zero.

 

Left: GLSL result Right: SPIR-V result

 

ripple:
I added a dump module to find out what the active attributes and uniform variables are.

 

NVIDIA SPIR-V (Geforce 750ti)
[Attribute: 2]
Idx Type           Name
  0 vec3           'a_pos'
  1 vec3           'a_uv'
[Uniform: 3]
Idx Type           Name
  0 sampler2d      'image'
  1 vec2           'rippledata.center1'
  2 vec2           'rippledata.img_size'
[UniformBlock: 1]
Idx Name
  0 'rippledata'(block member count: 2)
  |_Idx Type       Offset Name
      0 vec2            8 'rippledata.center1'
      1 vec2            0 'rippledata.img_size'
----------------------------------------------------------------------
AMD SPIR-V (Radeon RX560)
[Attribute: 2]
Idx Type           Name
  0 vec4           ''
  0 vec4           ''
[Uniform: 1]
Idx Type           Name
  0 sampler2d      ''
[UniformBlock: 0]
----------------------------------------------------------------------
AMD GLSL (Radeon RX560)
[Attribute: 2]
Idx Type           Name
  0 vec3           'a_pos'
  1 vec3           'a_uv'
[Uniform: 3]
Idx Type           Name
  0 vec2           'rippledata.img_size'
  1 vec2           'rippledata.center1'
  2 sampler2d      'image'
[UniformBlock: 1]
Idx Name
  0 'rippledata'(block member count: 2)
  |_Idx Type       Offset Name
      0 vec2            0 'rippledata.img_size'
      1 vec2            8 'rippledata.center1'
----------------------------------------------------------------------

Left: GLSL result Right: SPIR-V result

This program uses uniform block with named-block.  I also tested name-less uniform block and default uniform block(= uniform), but none of them worked.

 

Am I making something wrong? :)

 

These programs work fine following GPU/GPU driver.
* NVIDIA Geforce GTX 750 Ti, Windows7
* AMD Ryzen3 2200G with Radeon Vega Graphcis x 4, Linux Mint 19.3 Mesa 20.0.0-devel

 

Thank you.

Attachments

Outcomes