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

Merge branch 'master' into feat/renderers-cleanup

This commit is contained in:
2026-11-16 21:44:48 +01:00
264 changed files with 41203 additions and 10041 deletions

View File

@@ -1769,6 +1769,31 @@ void vulkan14_renderer::walk_cull_face(bool const Enabled)
m_draw->cullface = Enabled;
}
void vulkan14_renderer::walk_decal(bool const Enabled)
{
auto &draw{*m_draw};
if ((false == draw.rendering) || (draw.commands == nullptr) || draw.shadows)
{
return;
}
// the depth is reversed (VK_COMPARE_OP_GREATER_OR_EQUAL): a positive bias comes nearer the camera, as glPolygonOffset(2, 8) of
// the opengl renderer (slope 2, constant 8). the depth pass of the scene draws everything a little farther (-1, -1,
// render_scene_depth()), the decal goes as much nearer from there
if (draw.depthpass)
{
if (Enabled)
draw.commands->set_depth_bias(-1.f + 8.f, 0.f, -1.f + 2.f);
else
draw.commands->set_depth_bias(-1.f, 0.f, -1.f);
return;
}
draw.commands->set_depth_bias_enable(Enabled ? VK_TRUE : VK_FALSE);
if (Enabled)
{
draw.commands->set_depth_bias(8.f, 0.f, 2.f);
}
}
void vulkan14_renderer::walk_glare(bool const Enabled)
{
// without the depth test, added to what is there
@@ -2691,3 +2716,13 @@ ITexture const &vulkan14_renderer::Texture(texture_handle const Texture) const
}
return m_context->textures->texture(Texture);
}
void vulkan14_renderer::Unload_Texture(texture_handle const Texture)
{
if ((Texture == null_handle) || !m_context || !m_context->textures)
{
return;
}
// the image goes once the gpu is done with it (vulkan14_texture::release())
m_context->textures->unload(Texture);
}