17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 10:59:20 +02:00
Files
maszyna/betterRenderer/renderer/source/windshield_rain.h
maj00r 26501b0fd7 hoist standard includes above everything else
Ordering them before the imports in the same file was not enough: a
project header on line 1 can import a module several levels down whose
global module fragment already pulled in the same standard header, and
that include guard does not cross the module boundary. Putting them
first means the guard is set before anything can import.

Skips vendored single-header libraries and anything inside an #if.
2026-09-10 01:02:17 +02:00

49 lines
1.2 KiB
C++

#pragma once
#include <cstddef>
#include <cstdint>
#include <unordered_map>
#include "nvrenderer/nvrenderer.h"
struct WindshieldRain {
void Init(NvRenderer *in_renderer);
void Resize(int width, int height);
uint32_t width;
uint32_t height;
[[nodiscard]] nvrhi::ITexture *GetTexture() const;
void Render(NvRenderer::RenderPass const &pass);
bool IsRainShader(NvRenderer::MaterialTemplate const *mt) const;
size_t texture_handle_droplets;
size_t texture_handle_wipermask;
nvrhi::TextureHandle texture_droplets;
nvrhi::SamplerHandle sampler;
nvrhi::SamplerHandle sampler_point;
void CreatePso(nvrhi::ICommandList *command_list);
NvRenderer *renderer;
nvrhi::FramebufferHandle framebuffer;
nvrhi::TextureHandle tex_droplets;
nvrhi::TextureHandle tex_depth;
nvrhi::TextureHandle tex_depth_temp;
nvrhi::ShaderHandle ps_rain_anim;
nvrhi::ShaderHandle vs_rain_anim;
nvrhi::ShaderHandle cs_max_depth;
nvrhi::BindingSetHandle bindings;
nvrhi::BindingSetHandle bindings_max_depth;
nvrhi::GraphicsPipelineHandle pso_droplets;
nvrhi::ComputePipelineHandle pso_max_depth;
nvrhi::BindingLayoutHandle binding_layout;
std::unordered_map<size_t, nvrhi::BindingSetHandle> binding_sets_per_material;
};