mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 19:07:01 +02:00
graphics: refactoring #2
This commit is contained in:
@@ -9,13 +9,9 @@
|
||||
|
||||
namespace Libs::Graphics {
|
||||
|
||||
class CommandBuffer;
|
||||
class RenderCommandBuffer;
|
||||
struct DepthStencilVulkanImage;
|
||||
|
||||
namespace HW {
|
||||
class Context;
|
||||
} // namespace HW
|
||||
|
||||
inline constexpr bool depth_htile_stencil_acceleration_compatible(bool has_stencil, bool has_htile,
|
||||
bool acceleration_disabled) {
|
||||
return acceleration_disabled || (has_stencil && has_htile);
|
||||
@@ -60,22 +56,20 @@ struct RenderDepthInfo {
|
||||
int vaddr_num = 0;
|
||||
};
|
||||
|
||||
inline bool depth_attachment_read_only(const RenderDepthInfo* depth) {
|
||||
EXIT_IF(depth == nullptr);
|
||||
inline bool depth_attachment_read_only(const RenderDepthInfo& depth) {
|
||||
const bool stencil_write =
|
||||
depth->stencil_test_enable &&
|
||||
(depth->stencil_dynamic_front.writeMask != 0 || depth->stencil_dynamic_back.writeMask != 0);
|
||||
return !depth->depth_load_clear_enable && !depth->stencil_clear_enable &&
|
||||
!depth->depth_write_enable && !stencil_write;
|
||||
depth.stencil_test_enable &&
|
||||
(depth.stencil_dynamic_front.writeMask != 0 || depth.stencil_dynamic_back.writeMask != 0);
|
||||
return !depth.depth_load_clear_enable && !depth.stencil_clear_enable &&
|
||||
!depth.depth_write_enable && !stencil_write;
|
||||
}
|
||||
|
||||
inline vk::ImageLayout depth_attachment_layout(const RenderDepthInfo* depth) {
|
||||
inline vk::ImageLayout depth_attachment_layout(const RenderDepthInfo& depth) {
|
||||
return depth_attachment_read_only(depth) ? vk::ImageLayout::eDepthStencilReadOnlyOptimal
|
||||
: vk::ImageLayout::eDepthStencilAttachmentOptimal;
|
||||
}
|
||||
|
||||
void ResolveRenderDepthTarget(uint64_t submit_id, CommandBuffer* buffer, const HW::Context& hw,
|
||||
RenderDepthInfo* r);
|
||||
void ResolveRenderDepthTarget(uint64_t submit_id, RenderCommandBuffer& buffer, RenderDepthInfo& r);
|
||||
void MarkRenderTargetGpuWritten(const RenderDepthInfo& target);
|
||||
|
||||
} // namespace Libs::Graphics
|
||||
|
||||
Reference in New Issue
Block a user