mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 05:38:49 +00:00
liverpool: Write valid queries on PixelPipeStatDump (#3553)
* liverpool: Write valid queries on PixelPipeStatDump * export: Small assert swap * liverpool: Advance zpass counter on every dump request
This commit is contained in:
@@ -129,12 +129,13 @@ void Translator::EmitExport(const GcnInst& inst) {
|
|||||||
return ExportRenderTarget(inst);
|
return ExportRenderTarget(inst);
|
||||||
}
|
}
|
||||||
|
|
||||||
ASSERT_MSG(!exp.compr, "Compressed exports only supported for render targets");
|
|
||||||
if (attrib == IR::Attribute::Depth && exp.en != 0 && exp.en != 1) {
|
if (attrib == IR::Attribute::Depth && exp.en != 0 && exp.en != 1) {
|
||||||
LOG_WARNING(Render_Vulkan, "Unsupported depth export");
|
LOG_WARNING(Render_Vulkan, "Unsupported depth export");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ASSERT_MSG(!exp.compr, "Compressed exports only supported for render targets");
|
||||||
|
|
||||||
u32 mask = exp.en;
|
u32 mask = exp.en;
|
||||||
for (u32 i = 0; i < 4; i++, mask >>= 1) {
|
for (u32 i = 0; i < 4; i++, mask >>= 1) {
|
||||||
if ((mask & 1) == 0) {
|
if ((mask & 1) == 0) {
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "common/polyfill_thread.h"
|
#include "common/polyfill_thread.h"
|
||||||
#include "common/thread.h"
|
#include "common/thread.h"
|
||||||
#include "core/debug_state.h"
|
#include "core/debug_state.h"
|
||||||
|
#include "core/libraries/kernel/process.h"
|
||||||
#include "core/libraries/videoout/driver.h"
|
#include "core/libraries/videoout/driver.h"
|
||||||
#include "core/memory.h"
|
#include "core/memory.h"
|
||||||
#include "video_core/amdgpu/liverpool.h"
|
#include "video_core/amdgpu/liverpool.h"
|
||||||
@@ -64,6 +65,7 @@ static std::span<const u32> NextPacket(std::span<const u32> span, size_t offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Liverpool::Liverpool() {
|
Liverpool::Liverpool() {
|
||||||
|
num_counter_pairs = Libraries::Kernel::sceKernelIsNeoMode() ? 16 : 8;
|
||||||
process_thread = std::jthread{std::bind_front(&Liverpool::Process, this)};
|
process_thread = std::jthread{std::bind_front(&Liverpool::Process, this)};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,7 +165,7 @@ Liverpool::Task Liverpool::ProcessCeUpdate(std::span<const u32> ccb) {
|
|||||||
const auto* it_body = reinterpret_cast<const u32*>(header) + 1;
|
const auto* it_body = reinterpret_cast<const u32*>(header) + 1;
|
||||||
switch (opcode) {
|
switch (opcode) {
|
||||||
case PM4ItOpcode::Nop: {
|
case PM4ItOpcode::Nop: {
|
||||||
const auto* nop = reinterpret_cast<const PM4CmdNop*>(header);
|
// const auto* nop = reinterpret_cast<const PM4CmdNop*>(header);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case PM4ItOpcode::WriteConstRam: {
|
case PM4ItOpcode::WriteConstRam: {
|
||||||
@@ -604,7 +606,15 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
|
|||||||
// immediately
|
// immediately
|
||||||
regs.cp_strmout_cntl.offset_update_done = 1;
|
regs.cp_strmout_cntl.offset_update_done = 1;
|
||||||
} else if (event->event_index.Value() == EventIndex::ZpassDone) {
|
} else if (event->event_index.Value() == EventIndex::ZpassDone) {
|
||||||
LOG_WARNING(Render, "Unimplemented occlusion query");
|
if (event->event_type.Value() == EventType::PixelPipeStatDump) {
|
||||||
|
static constexpr u64 OcclusionCounterValidMask = 0x8000000000000000ULL;
|
||||||
|
static constexpr u64 OcclusionCounterStep = 0x2FFFFFFULL;
|
||||||
|
u64* results = event->Address<u64*>();
|
||||||
|
for (s32 i = 0; i < num_counter_pairs; ++i, results += 2) {
|
||||||
|
*results = pixel_counter | OcclusionCounterValidMask;
|
||||||
|
}
|
||||||
|
pixel_counter += OcclusionCounterStep;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1666,6 +1666,8 @@ private:
|
|||||||
u32 num_mapped_queues{1u}; // GFX is always available
|
u32 num_mapped_queues{1u}; // GFX is always available
|
||||||
|
|
||||||
VAddr indirect_args_addr{};
|
VAddr indirect_args_addr{};
|
||||||
|
u32 num_counter_pairs{};
|
||||||
|
u64 pixel_counter{};
|
||||||
|
|
||||||
struct ConstantEngine {
|
struct ConstantEngine {
|
||||||
void Reset() {
|
void Reset() {
|
||||||
|
|||||||
@@ -415,6 +415,13 @@ struct PM4CmdEventWrite {
|
|||||||
BitField<20, 1, u32> inv_l2; ///< Send WBINVL2 op to the TC L2 cache when EVENT_INDEX = 0111
|
BitField<20, 1, u32> inv_l2; ///< Send WBINVL2 op to the TC L2 cache when EVENT_INDEX = 0111
|
||||||
};
|
};
|
||||||
u32 address[];
|
u32 address[];
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
T Address() const {
|
||||||
|
ASSERT(event_index.Value() >= EventIndex::ZpassDone &&
|
||||||
|
event_index.Value() <= EventIndex::SampleStreamoutStatSx);
|
||||||
|
return std::bit_cast<T>((u64(address[1]) << 32u) | u64(address[0]));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct PM4CmdEventWriteEop {
|
struct PM4CmdEventWriteEop {
|
||||||
|
|||||||
Reference in New Issue
Block a user