mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-26 03:55:37 +00:00
clang-format
This commit is contained in:
parent
34f0f03f99
commit
979e17459f
@ -402,17 +402,16 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
||||
if (rasterizer) {
|
||||
rasterizer->EndPredication();
|
||||
}
|
||||
}
|
||||
else if (predication->pred_op.Value() == PredicateOperation::Zpass) {
|
||||
} else if (predication->pred_op.Value() == PredicateOperation::Zpass) {
|
||||
if (rasterizer) {
|
||||
rasterizer->StartPredication(predication->Address<VAddr>(),
|
||||
rasterizer->StartPredication(
|
||||
predication->Address<VAddr>(),
|
||||
predication->action.Value() == Predication::DrawIfVisible,
|
||||
predication->hint.Value() == PredicationHint::Wait);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
LOG_WARNING(Render_Vulkan, "unhandled predicate operation {}",
|
||||
magic_enum::enum_name(predication->pred_op.Value()));
|
||||
magic_enum::enum_name(predication->pred_op.Value()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -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_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) {
|
||||
// occlusion query start
|
||||
if (rasterizer) {
|
||||
rasterizer->StartOcclusionQuery(event->Address<VAddr>());
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// occlusion query end
|
||||
if (rasterizer) {
|
||||
rasterizer->EndOcclusionQuery(event->Address<VAddr>() & ~0xF);
|
||||
|
@ -419,7 +419,7 @@ struct PM4CmdEventWrite {
|
||||
template <typename T>
|
||||
T Address() const {
|
||||
ASSERT(event_index.Value() >= EventIndex::ZpassDone &&
|
||||
event_index.Value() <= EventIndex::SampleStreamoutStatSx);
|
||||
event_index.Value() <= EventIndex::SampleStreamoutStatSx);
|
||||
return reinterpret_cast<T>((u64(address[1]) << 32u) | u64(address[0]));
|
||||
}
|
||||
};
|
||||
@ -1145,7 +1145,8 @@ struct PM4CmdSetPredication {
|
||||
|
||||
template <typename T = u64>
|
||||
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
|
||||
|
||||
namespace {
|
||||
const int OCCLUSION_QUERIES_COUNT = 16;
|
||||
const int OCCLUSION_QUERIES_COUNT = 16;
|
||||
}
|
||||
|
||||
namespace Vulkan {
|
||||
@ -43,8 +43,13 @@ Rasterizer::Rasterizer(const Instance& instance_, Scheduler& scheduler_,
|
||||
buffer_cache{instance, scheduler, *this, liverpool_, texture_cache, page_manager},
|
||||
texture_cache{instance, scheduler, buffer_cache, page_manager}, liverpool{liverpool_},
|
||||
memory{Core::Memory::Instance()}, pipeline_cache{instance, scheduler, liverpool},
|
||||
occlusion_query_buffer{instance, scheduler, VideoCore::MemoryUsage::DeviceLocal, 0,
|
||||
vk::BufferUsageFlagBits::eConditionalRenderingEXT | vk::BufferUsageFlagBits::eTransferDst, sizeof(u32)*OCCLUSION_QUERIES_COUNT} {
|
||||
occlusion_query_buffer{instance,
|
||||
scheduler,
|
||||
VideoCore::MemoryUsage::DeviceLocal,
|
||||
0,
|
||||
vk::BufferUsageFlagBits::eConditionalRenderingEXT |
|
||||
vk::BufferUsageFlagBits::eTransferDst,
|
||||
sizeof(u32) * OCCLUSION_QUERIES_COUNT} {
|
||||
if (!Config::nullGpu()) {
|
||||
liverpool->BindRasterizer(this);
|
||||
}
|
||||
@ -54,7 +59,8 @@ Rasterizer::Rasterizer(const Instance& instance_, Scheduler& scheduler_,
|
||||
.queryCount = 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;
|
||||
@ -1290,8 +1296,9 @@ void Rasterizer::StartPredication(VAddr addr, bool draw_if_visible, bool wait_fo
|
||||
const auto cmdbuf = scheduler.CommandBuffer();
|
||||
|
||||
cmdbuf.copyQueryPoolResults(occlusion_query_pool, index, 1, occlusion_query_buffer.Handle(),
|
||||
index*sizeof(u32), sizeof(u32), wait_for_result ? vk::QueryResultFlagBits::eWait
|
||||
: vk::QueryResultFlagBits::ePartial);
|
||||
index * sizeof(u32), sizeof(u32),
|
||||
wait_for_result ? vk::QueryResultFlagBits::eWait
|
||||
: vk::QueryResultFlagBits::ePartial);
|
||||
|
||||
const auto pre_barrier = vk::BufferMemoryBarrier2{
|
||||
.srcStageMask = vk::PipelineStageFlagBits2::eCopy,
|
||||
@ -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)));
|
||||
vk::ConditionalRenderingBeginInfoEXT conditional_rendering_info {
|
||||
vk::ConditionalRenderingBeginInfoEXT conditional_rendering_info{
|
||||
.buffer = occlusion_query_buffer.Handle(),
|
||||
.offset = index * sizeof(u32),
|
||||
.flags = draw_if_visible ? vk::ConditionalRenderingFlagBitsEXT::eInverted
|
||||
|
Loading…
Reference in New Issue
Block a user