mirror of
https://github.com/harfang3d/harfang3d.git
synced 2024-06-01 22:02:42 +00:00
31 lines
970 B
C++
31 lines
970 B
C++
// HARFANG(R) Copyright (C) 2021 Emmanuel Julien, NWNC HARFANG. Released under GPL/LGPL/Commercial Licence, see licence.txt for details.
|
|
|
|
#pragma once
|
|
|
|
#include "engine/render_pipeline.h"
|
|
#include "foundation/rect.h"
|
|
|
|
namespace hg {
|
|
|
|
struct Downsample {
|
|
bgfx::ProgramHandle compute = BGFX_INVALID_HANDLE;
|
|
bgfx::UniformHandle u_color = BGFX_INVALID_HANDLE;
|
|
bgfx::UniformHandle u_attr0 = BGFX_INVALID_HANDLE; // xyz: normal, w: linear depth
|
|
bgfx::UniformHandle u_depth = BGFX_INVALID_HANDLE;
|
|
|
|
bgfx::FrameBufferHandle fb = BGFX_INVALID_HANDLE;
|
|
Texture color, attr0, depth;
|
|
};
|
|
|
|
Downsample CreateDownsampleFromFile(const char *path);
|
|
Downsample CreateDownsampleFromAssets(const char *path);
|
|
|
|
void DestroyDownsample(Downsample &downsample);
|
|
|
|
void ComputeDownsample(
|
|
bgfx::ViewId &view_id, const iRect &rect, const Texture &color, const Texture &attr0, const Texture &depth, const Downsample &downsample);
|
|
|
|
bool IsValid(const Downsample &downsample);
|
|
|
|
} // namespace hg
|