Handle predication PM4 commands

This commit is contained in:
Marcin Mikołajczyk 2025-05-26 22:46:35 +01:00
parent d2ed73005e
commit 0543f1fd6d
3 changed files with 30 additions and 1 deletions

View File

@ -394,7 +394,24 @@ Liverpool::Task Liverpool::ProcessGraphics(std::span<const u32> dcb, std::span<c
break;
}
case PM4ItOpcode::SetPredication: {
LOG_WARNING(Render_Vulkan, "Unimplemented IT_SET_PREDICATION");
const auto* predication = reinterpret_cast<const PM4CmdSetPredication*>(header);
if (predication->continue_bit.Value()) {
LOG_WARNING(Render_Vulkan, "unhandled continue bit in predication command");
}
if (predication->pred_op.Value() == PredicateOperation::Clear) {
if (rasterizer) {
rasterizer->EndPredication();
}
}
else if (predication->pred_op.Value() == PredicateOperation::Zpass) {
if (rasterizer) {
rasterizer->StartPredication();
}
}
else {
LOG_WARNING(Render_Vulkan, "unhandled predicate operation {}",
magic_enum::enum_name(predication->pred_op.Value()));
}
break;
}
case PM4ItOpcode::IndexType: {

View File

@ -1263,4 +1263,13 @@ void Rasterizer::ScopedMarkerInsertColor(const std::string_view& str, const u32
(f32)(color & 0xff) / 255.0f, (f32)((color >> 24) & 0xff) / 255.0f})});
}
void Rasterizer::StartPredication() {
}
void Rasterizer::EndPredication() {
}
} // namespace Vulkan

View File

@ -55,6 +55,9 @@ public:
void ScopedMarkerInsertColor(const std::string_view& str, const u32 color,
bool from_guest = false);
void StartPredication();
void EndPredication();
void InlineData(VAddr address, const void* value, u32 num_bytes, bool is_gds);
u32 ReadDataFromGds(u32 gsd_offset);
bool InvalidateMemory(VAddr addr, u64 size);