17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-19 14:18:49 +02:00
Files
maszyna/betterRenderer/renderer/source/contactshadows.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

37 lines
1.0 KiB
C++

#pragma once
#include <cstdint>
#include <nvrhi/nvrhi.h>
import eu07.glm;
struct MaContactShadows {
MaContactShadows(class NvRenderer* renderer, class NvGbuffer* gbuffer);
void Init();
void Render(nvrhi::ICommandList* command_list);
void UpdateConstants(nvrhi::ICommandList* command_list,
const glm::dmat4& projection, const glm::dmat4& view,
const glm::dvec3& light, uint64_t frame_index);
struct ComputeConstants {
glm::mat4 g_Projection;
glm::mat4 g_InverseProjection;
glm::vec3 g_LightDirView;
float g_NumSamples;
float g_SampleRange;
float g_Thickness;
uint32_t g_FrameIndex;
};
nvrhi::BindingLayoutHandle m_binding_layout;
nvrhi::BindingSetHandle m_binding_set;
nvrhi::ComputePipelineHandle m_pipeline;
nvrhi::ShaderHandle m_compute_shader;
nvrhi::BufferHandle m_constant_buffer;
nvrhi::TextureHandle m_output_texture;
class NvRendererBackend* m_backend;
class NvGbuffer* m_gbuffer;
int m_width;
int m_height;
};