cancel
Showing results for 
Search instead for 
Did you mean: 

Graphics Cards

ptatar
Journeyman III

Nonuniform array access

Hello,

I have question releted to nonuniform access to array of uniforms.

Shader

#version 450

layout(set = 0, binding = 0, std140) uniform _Global

{

vec4 vfuniforms[48];

} _31;

layout(location = 0) in vec4 pos;

layout(location = 1) in uint vbatch;

void main()

{

float _129 = float(vbatch * 2u);

vec4 _152 = vec4(0.0, 0.0, 0.0, 1.0);

_152.x = dot(pos, _31.vfuniforms[uint(_129 + 0.100000001490116119384765625)]);

vec4 _154 = _152;

_154.y = dot(pos, _31.vfuniforms[uint(_129 + 1.10000002384185791015625)]);

gl_Position = _154;

}

It works fine on NVIDIA graphics card for both dx and vk. But on my Vega56 it works only for dx implementation and fail for vk implementation (for both dxc and shaderc). On Vk it renders some weird things. I can make it work by changing indices used to access vfuniforms for example (because I know that for my data it's only 2 possible values).

Shader1

_152.x = dot(pos, _31.vfuniforms[0]);

vec4 _154 = _152;

_154.y = dot(pos, _31.vfuniforms[1]);

Is this not supported feature on AMD GPU or it should work fine and I should blame my code for it or maybe I should do something more to make it work? I'm quite new to vulkan so I hope it's not dumb question.

0 Likes
3 Replies

AMD Drivers support and install Vulkan. Your Vega56 definitely supports Vulan.

From AMD Vega56 Specs:

So I would look at your software or program to see why it is not able to run Vulkan.

Here is the latest AMD Driver for the Vega56 from AMD Download page: Radeon™ Software Adrenalin 2019 Edition 19.1.1 Release Notes | AMD

0 Likes

Thank you for your reply.I know that my GPU supports Vulkan question is if its support nonuniform array access. Because shader that I attached above compiles but is not working as intended.

0 Likes

Since you seem to be a Vulkan programmer or are trying to use code to run Vulkan, I believe you best place to ask is from AMD OpenGL/Vulkan Forum. They should be able to assist you with your programming and answering your question.: OpenGL & Vulkan

0 Likes