forked from FrictionalGames/AmnesiaTheDarkDescent
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #109 from OSS-Cosmic/feature/visibility-buffer-ill…
…uminiation-translucency feature: visibility buffer illuminiation translucency
- Loading branch information
Showing
27 changed files
with
611 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "graphics/ForgeRenderer.h" | ||
#include "graphics/ForgeHandles.h" | ||
|
||
namespace hpl { | ||
|
||
class CopyTextureSubpass4 { | ||
public: | ||
|
||
static constexpr uint32_t NumberOfDescriptors = 32; | ||
CopyTextureSubpass4(CopyTextureSubpass4&&) = default; | ||
CopyTextureSubpass4(CopyTextureSubpass4&) = delete; | ||
CopyTextureSubpass4(hpl::ForgeRenderer& renderer); | ||
void operator=(CopyTextureSubpass4&) = delete; | ||
CopyTextureSubpass4& operator=(CopyTextureSubpass4&&) = default; | ||
|
||
void Dispatch(ForgeRenderer::Frame& frame, Texture* src, Texture* dest); | ||
private: | ||
SharedRootSignature m_copyRootSignature; | ||
std::array<SharedDescriptorSet, ForgeRenderer::SwapChainLength> m_copyPerFrameSet; | ||
SharedPipeline m_copyPipline; | ||
SharedShader m_copyShader; | ||
std::array<uint32_t, ForgeRenderer::SwapChainLength> m_index; | ||
}; | ||
} // namespace hpl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#pragma once | ||
|
||
#include "Common_3/Graphics/Interfaces/IGraphics.h" | ||
#include <span> | ||
|
||
namespace hpl { | ||
class RenderTargetScopedBarrier; | ||
struct RenderTargetTransition { | ||
RenderTargetScopedBarrier* m_resource; | ||
ResourceState m_newState; | ||
}; | ||
|
||
namespace ScopedBarrier { | ||
void End( | ||
Cmd* cmd, | ||
std::span<RenderTargetScopedBarrier*> | ||
); | ||
|
||
void Transition( | ||
Cmd* cmd, | ||
std::span<RenderTargetTransition> | ||
); | ||
}; | ||
|
||
class RenderTargetScopedBarrier { | ||
public: | ||
RenderTargetScopedBarrier(); | ||
RenderTargetScopedBarrier(RenderTarget* target, ResourceState start, ResourceState end); | ||
RenderTargetScopedBarrier(RenderTargetScopedBarrier&) = delete; | ||
RenderTargetScopedBarrier(RenderTargetScopedBarrier&&); | ||
|
||
void Set(RenderTarget* target, ResourceState start, ResourceState end); | ||
void operator=(RenderTargetBarrier&) = delete; | ||
void operator=(RenderTargetScopedBarrier&&); | ||
|
||
~RenderTargetScopedBarrier() { | ||
// scope hasn't been closed | ||
ASSERT(m_target == nullptr); | ||
} | ||
|
||
inline bool IsValid() { | ||
return m_target != nullptr; | ||
} | ||
|
||
inline RenderTarget* Target() { | ||
return m_target; | ||
} | ||
|
||
private: | ||
ResourceState m_startState; | ||
ResourceState m_currentState; | ||
ResourceState m_endState; | ||
RenderTarget* m_target = nullptr; | ||
|
||
friend void ScopedBarrier::End(Cmd*, std::span<RenderTargetScopedBarrier*>); | ||
friend void ScopedBarrier::Transition(Cmd*, std::span<RenderTargetTransition>); | ||
|
||
}; | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.