Merge pull request #1936 from ludovic111/fix/opengl-gl33

🤖 Agent: merged after verify and real GL runs on the ThinkPad (Intel HD 620, GL 3.3 with extensions hidden: title, server thread and in-frame render, 0 errors; screenshots match Vulkan). Released at once: any GL driver without compute shaders crashed at start without it.
This commit is contained in:
Ludovic Marie
2026-10-25 22:10:39 +01:00
committed by GitHub
+15 -4
View File
@@ -2182,15 +2182,26 @@ impl Renderer {
)
});
let sorted_indices = arena::Arena::indices(&device, 1 << 16, flat.is_some());
let multi_draw = device
.features()
.contains(wgpu::Features::INDIRECT_FIRST_INSTANCE)
&& adapter
.get_downlevel_capabilities()
.flags
.contains(wgpu::DownlevelFlags::INDIRECT_EXECUTION);
// Without indirect draws (OpenGL before 4.3 without compute shaders)
// even creating an indirect buffer fails; one draw per section reads
// `draws` on the CPU instead.
let indirect = device.create_buffer(&wgpu::BufferDescriptor {
label: Some("Section draws"),
size: 1024 * 20,
usage: wgpu::BufferUsages::INDIRECT | wgpu::BufferUsages::COPY_DST,
usage: if multi_draw {
wgpu::BufferUsages::INDIRECT | wgpu::BufferUsages::COPY_DST
} else {
wgpu::BufferUsages::COPY_DST
},
mapped_at_creation: false,
});
let multi_draw = device
.features()
.contains(wgpu::Features::INDIRECT_FIRST_INSTANCE);
// HORIZON_GPU_CULL=0 turns occlusion culling off, `all` culls every
// frame however few its draws and little it hides, `shader` tests in
// the shader as on Metal (A/B checks).