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.
feat: attempt to address rendering problems with radv mesa
Signed-off-by: Michael Pollind <[email protected]>
- Loading branch information
Showing
21 changed files
with
705 additions
and
541 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
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
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
Oops, something went wrong.