mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-03 10:05:23 +01:00
99b9265110
The drivers of integrated Intel graphics offer 16 shader storage buffer
binding points (GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS). The OpenGL 4.6
renderer used 16 (the water of the windscreens), 17 (the spherical
harmonics of the cab probe) and 18 (the cells of the rain). Every material
shader includes light_common.glsl, which declares the cab probe block, so
none of them compiled on Intel and the whole scenery was drawn pink
("shader storage buffer binding must be less than ... (16)").
- the sky light (sky_ubo) and the light of the cab probe (cab_probe_ubo)
are uniform blocks now: 9 vec4 each, which every fragment reads the
same of, and which std140 lays out as std430 did. cabprobe_sh.comp still
writes the probe's buffer as a storage buffer, bound right before its
dispatch (gl::ssbo::bind_uniform() binds the same buffer as the block)
- the result of the atmosphere and the write of the cab probe share
binding point 9 with the other compute passes, which bind theirs right
before their dispatch; the sky no longer keeps the atmosphere result bound
- the water of the windscreens takes point 5 and the rain cells point 7
- gl::MAX_SSBO_BINDINGS (16) with a static_assert over every point, and
the log gives the points the driver offers at start, with an error when
there are fewer
No extra binds per draw: the cost on NVIDIA and AMD stays what it was.
The SPIR-V binaries of shaders/ogl46bin/ compiled from the old common.glsl
are out of date and the shaders are compiled from the sources until they
are made again (shaders/compile_spirv.py).
feat/gl46-migration has the same points (water 16, cab probe 17) and needs
the same change.