# Based on multiple-resident-images-reading.shader_test # in row_major SSBOs, [n][m] should not use the same memory location as # [m][n], and they shouldn't use the same location as[0][m+n]. [require] GL >= 4.3 GLSL >= 4.30 [compute shader] #version 430 #extension GL_ARB_bindless_texture: enable layout(row_major, binding=0) buffer b { mat4 m; }; layout (bindless_image) uniform; writeonly uniform image2D dst; layout(local_size_x = 16, local_size_y = 16) in; void main() { m[0][3] = 0.1f; m[1][2] = 0.2f; m[2][1] = 0.3f; m[1][3] = 0.4f; m[3][1] = 0.5f; memoryBarrierBuffer(); barrier(); vec4 color = vec4(m[0][3], m[1][2], m[2][1], m[1][3]); imageStore(dst, ivec2(gl_GlobalInvocationID.xy), color); } [test] # Setup dst image and SSBO texture rgbw 0 (16, 16) GL_RGBA8 resident image texture 0 GL_RGBA8 uniform handle dst 0 fb tex 2d 0 ssbo 0 64 # run compute shader compute 1 1 1 probe all rgba 0.1 0.2 0.3 0.4