17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 13:19:20 +02:00
Files
maszyna/betterRenderer/renderer/source/bloom.h
maj00r 61b3ec6f3f parse windows.h before any import reaches betterRenderer
Six module interfaces carry windows.h in their fragment, and a fragment's
include guard does not cross the boundary, so a unit that imported first
and included the SDK afterwards parsed it twice: clang reports it as
conflicting redeclarations of BroadcastSystemMessageEx and mismatched
uuids all through the SDK. Same shape as the basic_filebuf failure, one
level further out - the header arrives through d3d12.h, not directly.

Thirty units get a guarded windows.h ahead of everything; on Linux it is
a no-op. Vendored single-header libraries are left alone, and the block
goes after a BOM rather than before it.
2026-09-10 15:40:52 +02:00

40 lines
936 B
C++

#pragma once
#ifdef _WIN32
#include <windows.h> // before any import: its guard must be set here
#endif
#include <vector>
#include <nvrhi/nvrhi.h>
import eu07.glm;
struct Bloom {
struct BloomConstants {
glm::vec4 m_prefilter_vector;
float m_mix_factor;
};
float m_threshold = 3.f;
float m_knee = .6f;
float m_mix_factor = .04f;
bool m_gui_active = false;
void UpdateConstants(nvrhi::ICommandList* command_list);
void OnGui();
void ShowGui();
Bloom(class NvRendererBackend* backend) : m_backend(backend) {}
void Init(nvrhi::ITexture* texture);
void Render(nvrhi::ICommandList* command_list);
nvrhi::TextureHandle m_working_texture;
nvrhi::BufferHandle m_constant_buffer;
struct BloomStage {
int m_width;
int m_height;
nvrhi::BindingSetHandle m_binding_set;
nvrhi::ComputePipelineHandle m_pso;
};
std::vector<BloomStage> m_stages;
class NvRendererBackend* m_backend;
};