18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-19 06:26:01 +01:00

Some optimalisations

This commit is contained in:
2026-11-09 20:58:02 +01:00
parent d89b7dddf0
commit ff2ff308ed
20 changed files with 645 additions and 31 deletions

View File

@@ -173,6 +173,9 @@ class vulkan14_renderer : public gfx_renderer, public gfx::scene_walk
// the draws of the shared walk of the scene, recorded
void walk_material(material_handle const Material, TSubModel const *Submodel = nullptr, lighting_data const *Lighting = nullptr) override;
void walk_shadow_material(material_handle const Material) override;
// none for a texture made from a file of which every texel passes the alpha test (vk14::vulkan14_texture::passes_alpha_test()):
// the program without the test draws the same depth, without reading the texture and with the early depth test
texture_handle Indirect_Shadow_Texture(material_handle const Material) const override;
opengl_material const &walk_material_data(material_handle const Material) const override;
opengl_material const &walk_material_data(TSubModel const *Submodel) const override;
void walk_program(walk_shader const Program) override;
@@ -410,6 +413,17 @@ class vulkan14_renderer : public gfx_renderer, public gfx::scene_walk
// the depth of the whole opaque scene of the colour pass of the main viewport before its colour, for the contact shadows
// (Contactonly: with them alone) or for itself (gfx.depthprepass.scene), and the contact shadows set up to read it
void render_scene_depth(std::size_t const Viewport, glm::mat4 const &Future);
// the colour pass doesn't write the depth the prepass of the scene drew with the alpha test (draw_state::keepdepth); off in the debug
// window, to compare. what the prepass of the frame left out: a draw it had no pipeline or geometry for yet (the colour pass writes
// all of its depth then), the textures of the alpha test it found not loaded yet (their draws write it)
bool m_keepprepassdepth{true};
// the shadows of the textures which pass the alpha test everywhere drawn without it (Indirect_Shadow_Texture()), read from the
// main renderer by the walkers
bool m_shadowskipalphatest{true};
bool m_prepassincomplete{false};
std::vector<texture_handle> m_prepassunready;
// whether the prepass drew the depth of the draw of the material of the colour pass with the alpha test (walk_material())
bool prepassed_alpha(material_handle const Material, texture_handle const Texture);
bool contact_shadows_wanted(viewport_config const &Viewport) const;
void setup_contact_shadows(std::size_t const Viewport);
bool m_contactshadows{false};
@@ -493,7 +507,8 @@ class vulkan14_renderer : public gfx_renderer, public gfx::scene_walk
// its own, for the gpu times). Repeated: a bit for each input read texel by texel and repeated (the noise of the ssao)
void post_pass(char const *Fragment, vk14::image &Target, std::vector<vk14::image *> const &Inputs, vk14::draw_constants const &Constants, char const *Pass = nullptr, unsigned const Repeated = 0);
bool bind_scene_pipeline(vk14::scene_program &Program, vk14::target_formats const &Targets, vk14::blend_mode const Blend, int const Topology);
void apply_draw_state();
// Triangles: the draw is of triangles, which the prepass draws (keepdepth)
void apply_draw_state(bool const Triangles = false);
void push_textures();
bool texture_ready(texture_source &Texture);
texture_source &used_texture(texture_handle const Texture);