cancel
Showing results for 
Search instead for 
Did you mean: 

OpenGL & Vulkan

BoyBaykiller
Adept II

OpenGL Bug imageSize() causes crash when using GL_ARB_bindless_texture

I have a RX 5700 XT running newest driver (24.2.1). The following behaviour happens since driver 24.1.1.

When calling imageSize inside a shader while that shader is making use of GL_ARB_bindless_texture extension the
PC freezes for a bit and eventually the driver does some kind of reset.
 

This simple shader reproduces the issue.

#version 460 core
#extension GL_ARB_bindless_texture : require

layout(local_size_x = 8, local_size_y = 8, local_size_z = 1) in;

layout(binding = 0) writeonly uniform image2D ImgResult;

layout(std140, binding = 0) uniform Dummy {
    sampler2D SomethingBindless;
};

void main() {
    ivec2 imgCoord = ivec2(gl_GlobalInvocationID.xy);

    // imageSize(ImgResult) on image crashes on AMD drivers > 23.12.1
    vec2 uv = (imgCoord + 0.5) / imageSize(ImgResult);

    imageStore(ImgResult, imgCoord, vec4(uv, 0.0, 0.0));
}

 

0 Likes
1 Solution
BoyBaykiller
Adept II

This has been fixed in driver release 24.6.1. Thanks!

View solution in original post

0 Likes
3 Replies
BoyBaykiller
Adept II

Seems to be the same as what was described in https://community.amd.com/t5/opengl-vulkan/opengl-bindless-amp-imagesize-shader-driver-crash/m-p/614... by @RichPressence

Except that in my case it works with driver 23.5.2 (and probably the ones after til < 24.1.1) and for them it doesn't.

0 Likes
BoyBaykiller
Adept II

Edit: That is the accompanying host code for the compute shader I gave in my origional post.

uint32_t computeShaderProgram;
{
    uint32_t computeShader = glCreateShader(GL_COMPUTE_SHADER);
    glShaderSource(computeShader, 1, &computeShaderSrcCode, 0);
    glCompileShader(computeShader);

    computeShaderProgram = glCreateProgram();
    glAttachShader(computeShaderProgram, computeShader);
    glLinkProgram(computeShaderProgram);
}

while (!glfwWindowShouldClose(window))
{
    glUseProgram(computeShaderProgram);
    glDispatchCompute(1, 1, 1);

    glfwSwapBuffers(window);
    glfwPollEvents();
}

 

0 Likes
BoyBaykiller
Adept II

This has been fixed in driver release 24.6.1. Thanks!

0 Likes