mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-22 20:06:54 +02:00
Refactor(simplify) PM4 draw submission arguments
This commit is contained in:
@@ -73,13 +73,9 @@ public:
|
||||
void SetDrawIndirectArgsBaseAddress(uint64_t draw_indirect_args_base_addr);
|
||||
void SetDispatchIndirectArgsBaseAddress(uint64_t dispatch_indirect_args_base_addr);
|
||||
void SetNumInstances(uint32_t num_instances);
|
||||
void DrawIndex(uint32_t index_count, const void* index_addr, uint32_t flags, uint32_t type,
|
||||
uint32_t instance_count = 0, const void* object_ids = nullptr,
|
||||
uint32_t render_target_slice_offset = 0, int32_t vertex_offset_add = 0,
|
||||
uint32_t first_instance = 0, bool offsets_from_indirect_args = false);
|
||||
void DrawIndexOffset(uint32_t index_offset, uint32_t index_count, uint32_t flags);
|
||||
void DrawIndexAuto(uint32_t index_count, uint32_t flags,
|
||||
uint32_t render_target_slice_offset = 0);
|
||||
void DrawIndex(DrawIndexArgs args);
|
||||
void DrawIndexOffset(uint32_t index_offset, uint32_t index_count);
|
||||
void DrawIndexAuto(DrawAutoArgs args);
|
||||
void DrawIndirect(uint32_t data_offset, uint32_t draw_initiator, bool indexed);
|
||||
void DrawIndirectMulti(uint32_t data_offset, uint32_t max_count_or_count,
|
||||
const volatile uint32_t* count_addr, uint32_t stride_in_bytes,
|
||||
@@ -149,10 +145,6 @@ private:
|
||||
uint32_t interrupt_context_id);
|
||||
void ProcessPm4(Pm4Execution& execution, size_t stop_depth);
|
||||
void SuspendPm4();
|
||||
void SubmitNonIndexedDraw(uint32_t vertex_count, uint32_t flags,
|
||||
uint32_t render_target_slice_offset, uint32_t first_vertex,
|
||||
uint32_t first_instance, bool offsets_from_indirect_args = false);
|
||||
|
||||
CommandScheduler& GetScheduler() const { return m_renderer.GetCommandScheduler(); }
|
||||
CommandBuffer& CurrentBuffer() { return GetScheduler().Current(); }
|
||||
void CheckBuffer() const { GetScheduler().CheckActive(); }
|
||||
|
||||
@@ -1618,15 +1618,15 @@ KYTY_CP_OP_PARSER(CpOpDrawIndex) {
|
||||
auto* index_addr =
|
||||
reinterpret_cast<void*>(buffer[1] | (static_cast<uint64_t>(buffer[2]) << 32u));
|
||||
uint32_t max_instance_count = buffer[3];
|
||||
auto* object_ids =
|
||||
reinterpret_cast<void*>(buffer[4] | (static_cast<uint64_t>(buffer[5]) << 32u));
|
||||
uint32_t instance_count = buffer[6];
|
||||
uint32_t flags = buffer[7];
|
||||
uint32_t instance_count = buffer[6];
|
||||
uint32_t flags = buffer[7];
|
||||
|
||||
EXIT_NOT_IMPLEMENTED(instance_count > max_instance_count);
|
||||
EXIT_NOT_IMPLEMENTED((flags & ~0xa0u) != 0);
|
||||
|
||||
cp.DrawIndex(index_count, index_addr, 0, 1, instance_count, object_ids);
|
||||
cp.DrawIndex({.index_count = index_count,
|
||||
.index_addr = index_addr,
|
||||
.instance_count = instance_count});
|
||||
|
||||
return 8;
|
||||
}
|
||||
@@ -1641,7 +1641,7 @@ KYTY_CP_OP_PARSER(CpOpDrawIndex) {
|
||||
EXIT_NOT_IMPLEMENTED(index_count > max_index_count);
|
||||
EXIT_NOT_IMPLEMENTED((flags & ~0x20u) != 0);
|
||||
|
||||
cp.DrawIndex(index_count, index_addr, 0, 1);
|
||||
cp.DrawIndex({.index_count = index_count, .index_addr = index_addr});
|
||||
|
||||
return 5;
|
||||
}
|
||||
@@ -1700,7 +1700,7 @@ KYTY_CP_OP_PARSER(CpOpDrawIndexOffset) {
|
||||
EXIT_NOT_IMPLEMENTED(index_count > max_index_size);
|
||||
EXIT_NOT_IMPLEMENTED((flags & ~0x20u) != 0);
|
||||
|
||||
cp.DrawIndexOffset(index_offset, index_count, 0);
|
||||
cp.DrawIndexOffset(index_offset, index_count);
|
||||
|
||||
return 4;
|
||||
}
|
||||
@@ -1715,7 +1715,7 @@ KYTY_CP_OP_PARSER(CpOpDrawIndexAuto) {
|
||||
|
||||
EXIT_NOT_IMPLEMENTED((flags & ~0x22u) != 0);
|
||||
|
||||
cp.DrawIndexAuto(index_count, 0);
|
||||
cp.DrawIndexAuto({.vertex_count = index_count});
|
||||
|
||||
return 2;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user