Compute shader not working

Just as it says. This should set the color of the screen to pure white, but I only see the default fallback shaders.
//composite.csh
#version 430

layout (local_size_x = 16, local_size_y = 16) in;
layout (rgba8) uniform image2D colorimg0;

//const ivec3 workGroups = ivec3(50, 30, 1);
const vec2 workGroupsRender = vec2(1.0f, 1.0f);

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

imageStore(colorimg0, pixelCoords, vec4(1.0));
}
//composite.csh
#version 430

layout (local_size_x = 16, local_size_y = 16) in;
layout (rgba8) uniform image2D colorimg0;

//const ivec3 workGroups = ivec3(50, 30, 1);
const vec2 workGroupsRender = vec2(1.0f, 1.0f);

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

imageStore(colorimg0, pixelCoords, vec4(1.0));
}
I'm on an AMD RX 580, using Garuda Linux (basically Arch)
1 Reply
CyanEmber
CyanEmberOP13mo ago
Update: the code works only if you explicitly declare the format of the buffers. I was following an example compute shader for Optifine which didn't do this. I'm not sure if the code assumed that Optifine would make all buffers RGBA8 by default, or if it was an oversight by the code author. It could be worth looking into as a possible disparity or unintended behavior. It's worth noting that the format declarations do not work in compute shaders, not sure if this is intentional either.
Want results from more Discord servers?
Add your server