mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
clang-format
This commit is contained in:
parent
34f0f03f99
commit
979e17459f
@ -402,15 +402,14 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
|||||||
if (rasterizer) {
|
if (rasterizer) {
|
||||||
rasterizer->EndPredication();
|
rasterizer->EndPredication();
|
||||||
}
|
}
|
||||||
}
|
} else if (predication->pred_op.Value() == PredicateOperation::Zpass) {
|
||||||
else if (predication->pred_op.Value() == PredicateOperation::Zpass) {
|
|
||||||
if (rasterizer) {
|
if (rasterizer) {
|
||||||
rasterizer->StartPredication(predication->Address<VAddr>(),
|
rasterizer->StartPredication(
|
||||||
|
predication->Address<VAddr>(),
|
||||||
predication->action.Value() == Predication::DrawIfVisible,
|
predication->action.Value() == Predication::DrawIfVisible,
|
||||||
predication->hint.Value() == PredicationHint::Wait);
|
predication->hint.Value() == PredicationHint::Wait);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
LOG_WARNING(Render_Vulkan, "unhandled predicate operation {}",
|
LOG_WARNING(Render_Vulkan, "unhandled predicate operation {}",
|
||||||
magic_enum::enum_name(predication->pred_op.Value()));
|
magic_enum::enum_name(predication->pred_op.Value()));
|
||||||
}
|
}
|
||||||
@ -618,15 +617,13 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
|||||||
if (event->event_index.Value() == EventIndex::ZpassDone) {
|
if (event->event_index.Value() == EventIndex::ZpassDone) {
|
||||||
if (event->event_type.Value() == EventType::PixelPipeStatControl) {
|
if (event->event_type.Value() == EventType::PixelPipeStatControl) {
|
||||||
|
|
||||||
}
|
} else if (event->event_type.Value() == EventType::PixelPipeStatDump) {
|
||||||
else if (event->event_type.Value() == EventType::PixelPipeStatDump) {
|
|
||||||
if ((event->Address<u64>() & 0x8) == 0) {
|
if ((event->Address<u64>() & 0x8) == 0) {
|
||||||
// occlusion query start
|
// occlusion query start
|
||||||
if (rasterizer) {
|
if (rasterizer) {
|
||||||
rasterizer->StartOcclusionQuery(event->Address<VAddr>());
|
rasterizer->StartOcclusionQuery(event->Address<VAddr>());
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// occlusion query end
|
// occlusion query end
|
||||||
if (rasterizer) {
|
if (rasterizer) {
|
||||||
rasterizer->EndOcclusionQuery(event->Address<VAddr>() & ~0xF);
|
rasterizer->EndOcclusionQuery(event->Address<VAddr>() & ~0xF);
|
||||||
|
@ -1145,7 +1145,8 @@ struct PM4CmdSetPredication {
|
|||||||
|
|
||||||
template <typename T = u64>
|
template <typename T = u64>
|
||||||
T Address() const {
|
T Address() const {
|
||||||
return reinterpret_cast<T>(u64(start_address_lo.Value()) << 4 | u64(start_address_hi.Value()) << 32);
|
return reinterpret_cast<T>(u64(start_address_lo.Value()) << 4 |
|
||||||
|
u64(start_address_hi.Value()) << 32);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
const int OCCLUSION_QUERIES_COUNT = 16;
|
const int OCCLUSION_QUERIES_COUNT = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Vulkan {
|
namespace Vulkan {
|
||||||
@ -43,8 +43,13 @@ Rasterizer::Rasterizer(const Instance& instance_, Scheduler& scheduler_,
|
|||||||
buffer_cache{instance, scheduler, *this, liverpool_, texture_cache, page_manager},
|
buffer_cache{instance, scheduler, *this, liverpool_, texture_cache, page_manager},
|
||||||
texture_cache{instance, scheduler, buffer_cache, page_manager}, liverpool{liverpool_},
|
texture_cache{instance, scheduler, buffer_cache, page_manager}, liverpool{liverpool_},
|
||||||
memory{Core::Memory::Instance()}, pipeline_cache{instance, scheduler, liverpool},
|
memory{Core::Memory::Instance()}, pipeline_cache{instance, scheduler, liverpool},
|
||||||
occlusion_query_buffer{instance, scheduler, VideoCore::MemoryUsage::DeviceLocal, 0,
|
occlusion_query_buffer{instance,
|
||||||
vk::BufferUsageFlagBits::eConditionalRenderingEXT | vk::BufferUsageFlagBits::eTransferDst, sizeof(u32)*OCCLUSION_QUERIES_COUNT} {
|
scheduler,
|
||||||
|
VideoCore::MemoryUsage::DeviceLocal,
|
||||||
|
0,
|
||||||
|
vk::BufferUsageFlagBits::eConditionalRenderingEXT |
|
||||||
|
vk::BufferUsageFlagBits::eTransferDst,
|
||||||
|
sizeof(u32) * OCCLUSION_QUERIES_COUNT} {
|
||||||
if (!Config::nullGpu()) {
|
if (!Config::nullGpu()) {
|
||||||
liverpool->BindRasterizer(this);
|
liverpool->BindRasterizer(this);
|
||||||
}
|
}
|
||||||
@ -54,7 +59,8 @@ Rasterizer::Rasterizer(const Instance& instance_, Scheduler& scheduler_,
|
|||||||
.queryCount = OCCLUSION_QUERIES_COUNT,
|
.queryCount = OCCLUSION_QUERIES_COUNT,
|
||||||
}));
|
}));
|
||||||
instance.GetDevice().resetQueryPool(occlusion_query_pool, 0, OCCLUSION_QUERIES_COUNT);
|
instance.GetDevice().resetQueryPool(occlusion_query_pool, 0, OCCLUSION_QUERIES_COUNT);
|
||||||
Vulkan::SetObjectName(instance.GetDevice(), occlusion_query_buffer.Handle(), "OcclusionQueryBuffer:{:#x}", sizeof(u32)*OCCLUSION_QUERIES_COUNT);
|
Vulkan::SetObjectName(instance.GetDevice(), occlusion_query_buffer.Handle(),
|
||||||
|
"OcclusionQueryBuffer:{:#x}", sizeof(u32) * OCCLUSION_QUERIES_COUNT);
|
||||||
}
|
}
|
||||||
|
|
||||||
Rasterizer::~Rasterizer() = default;
|
Rasterizer::~Rasterizer() = default;
|
||||||
@ -1290,7 +1296,8 @@ void Rasterizer::StartPredication(VAddr addr, bool draw_if_visible, bool wait_fo
|
|||||||
const auto cmdbuf = scheduler.CommandBuffer();
|
const auto cmdbuf = scheduler.CommandBuffer();
|
||||||
|
|
||||||
cmdbuf.copyQueryPoolResults(occlusion_query_pool, index, 1, occlusion_query_buffer.Handle(),
|
cmdbuf.copyQueryPoolResults(occlusion_query_pool, index, 1, occlusion_query_buffer.Handle(),
|
||||||
index*sizeof(u32), sizeof(u32), wait_for_result ? vk::QueryResultFlagBits::eWait
|
index * sizeof(u32), sizeof(u32),
|
||||||
|
wait_for_result ? vk::QueryResultFlagBits::eWait
|
||||||
: vk::QueryResultFlagBits::ePartial);
|
: vk::QueryResultFlagBits::ePartial);
|
||||||
|
|
||||||
const auto pre_barrier = vk::BufferMemoryBarrier2{
|
const auto pre_barrier = vk::BufferMemoryBarrier2{
|
||||||
@ -1309,7 +1316,7 @@ void Rasterizer::StartPredication(VAddr addr, bool draw_if_visible, bool wait_fo
|
|||||||
});
|
});
|
||||||
|
|
||||||
ScopeMarkerBegin("gfx:{}:predication", fmt::ptr(reinterpret_cast<const void*>(addr)));
|
ScopeMarkerBegin("gfx:{}:predication", fmt::ptr(reinterpret_cast<const void*>(addr)));
|
||||||
vk::ConditionalRenderingBeginInfoEXT conditional_rendering_info {
|
vk::ConditionalRenderingBeginInfoEXT conditional_rendering_info{
|
||||||
.buffer = occlusion_query_buffer.Handle(),
|
.buffer = occlusion_query_buffer.Handle(),
|
||||||
.offset = index * sizeof(u32),
|
.offset = index * sizeof(u32),
|
||||||
.flags = draw_if_visible ? vk::ConditionalRenderingFlagBitsEXT::eInverted
|
.flags = draw_if_visible ? vk::ConditionalRenderingFlagBitsEXT::eInverted
|
||||||
|
Loading…
Reference in New Issue
Block a user