Pixel format of the window's GL context: PixelFormat { hardware_accelerated: true, color_bits: 24, alpha_bits: 8, depth_bits: 24, stencil_bits: 8, stereoscopy: false, double_buffer: true, multisampling: Some(4), srgb: true }
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "ERROR::SHADER::COMPILATION_FAILED\n0:52(14): warning: `i' used uninitialized\n0:52(42): warning: `i' used uninitialized\n0:0(0): error: Read from write-only variable `cmds'\n\n#version 430\nlayout(local_size_x = 1, local_size_y = 1) in;\n\n// Same as the OpenGL defined struct: DrawElementsIndirectCommand\nstruct DrawCommand {\n uint count; // Num elements (vertices)\n uint instanceCount; // Number of instances to draw (a.k.a primcount)\n uint firstIndex; // Specifies a byte offset (cast to a pointer type) into the buffer bound to GL_ELEMENT_ARRAY_BUFFER to start reading indices from.\n uint baseVertex; // Specifies a constant that should be added to each element of indices\u{200b} when chosing elements from the enabled vertex arrays.\n uint baseInstance; // Specifies the base instance for use in fetching instanced vertex attributes.\n};\n\n// Command buffer backed by a Shader Storage Object Buffer (SSBO)\nlayout(std140, binding = 0) writeonly buffer draw_commands {\n DrawCommand cmds[];\n};\n\nlayout (std430, binding=2) buffer transforms_buffer { \n mat4 transforms[];\n};\n\nstruct CurveData {\n uint points_count;\n uint pad0;\n uint pad1;\n uint pad2;\n vec4 positions[1000];\n};\n\nlayout (std430, binding=3) buffer curves_buffer { \n CurveData curves[];\n};\n\nlayout(rgba32f) uniform image2D road_mask;\n\nvoid main() {\n\n const uint idx = gl_GlobalInvocationID.x;\n //cmds[0].count = 312; // brick.glb vertex count\n uint instance_offset = atomicAdd(cmds[0].instanceCount, curves[idx].points_count); //https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/atomicAdd.xhtml\n //cmds[0].instanceCount = curves[idx].points_count;\n //cmds[0].firstIndex = 0; \n //cmds[0].baseVertex = 0; \n //cmds[0].baseInstance = 0; \n\n float offset = 0.0;\n vec4 pixel = imageLoad(road_mask, ivec2(512/2, 512/2)); //center of the image\n if (pixel.x > 0.0) {\n offset = 1.0;\n }\n\n for (int i; i<curves[idx].points_count; i++) {\n vec4 pt_position = curves[idx].positions[i];\n transforms[instance_offset+i] = transpose(mat4(\n 0.1, 0.0, 0.0, pt_position.x,\n 0.0, 0.1, 0.0, pt_position.y,\n 0.0, 0.0, 0.1, pt_position.z,\n 0.0, 0.0, 0.0, 1.0\n ));\n }\n\n //for (int i=0; i<3; i++) {\n //\n // transforms[i] = transpose(mat4(\n // 1.0, 0.0, 0.0, 0.0,\n // 0.0, 1.0, 0.0, float(i*1.5) + offset,\n // 0.0, 0.0, 1.0, 0.0,\n // 0.0, 0.0, 0.0, 1.0\n // ));\n //}\n} "', src/main.rs:189:92
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace