18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 08:04:57 +01:00

Optimise raytracing and buffer building

This commit is contained in:
2026-11-16 22:19:17 +01:00
parent 053e4cacee
commit b8815a2455
7 changed files with 69 additions and 48 deletions

View File

@@ -2819,10 +2819,6 @@ void vulkan14_renderer::render_grass(glm::mat4 const &Future)
auto const cullface{draw.cullface};
draw.cullface = false;
apply_draw_state();
if (draw.set_dirty)
{
bind_pass_set();
}
glm::mat4 const view{OpenGLMatrices.data(GL_MODELVIEW)};
auto const &frame{grass.frame()};
auto const &tiles{grass.tile_draws()};
@@ -2840,6 +2836,12 @@ void vulkan14_renderer::render_grass(glm::mat4 const &Future)
{
break;
}
// the block may have opened a new window of the blocks, which the pass set is bound with: without binding it again the
// chunk (and those after it) would read the blocks of other draws, and the grass would flicker
if (draw.set_dirty)
{
bind_pass_set();
}
std::array<VkDescriptorImageInfo, gl::MAX_TEXTURES> descriptors;
for (std::size_t unit = 0; unit < gl::MAX_TEXTURES; ++unit)
{