mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-05 14:31:24 +12:00
rsx: Avoid reallocating scratch buffers every draw call when processing instancing data
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
Some checks are pending
Generate Translation Template / Generate Translation Template (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 gcc (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04-arm clang (push) Waiting to run
Build RPCS3 / RPCS3 Linux ubuntu-24.04 clang (push) Waiting to run
Build RPCS3 / RPCS3 Windows (push) Waiting to run
This commit is contained in:
parent
b3bdff741c
commit
7500d16524
2 changed files with 11 additions and 3 deletions
|
@ -4,7 +4,6 @@
|
||||||
#include "Emu/RSX/Common/BufferUtils.h"
|
#include "Emu/RSX/Common/BufferUtils.h"
|
||||||
#include "Emu/RSX/Common/buffer_stream.hpp"
|
#include "Emu/RSX/Common/buffer_stream.hpp"
|
||||||
#include "Emu/RSX/Common/io_buffer.h"
|
#include "Emu/RSX/Common/io_buffer.h"
|
||||||
#include "Emu/RSX/Common/simple_array.hpp"
|
|
||||||
#include "Emu/RSX/NV47/HW/context_accessors.define.h"
|
#include "Emu/RSX/NV47/HW/context_accessors.define.h"
|
||||||
#include "Emu/RSX/Program/GLSLCommon.h"
|
#include "Emu/RSX/Program/GLSLCommon.h"
|
||||||
#include "Emu/RSX/rsx_methods.h"
|
#include "Emu/RSX/rsx_methods.h"
|
||||||
|
@ -759,7 +758,8 @@ namespace rsx
|
||||||
ensure(draw_call.is_trivial_instanced_draw);
|
ensure(draw_call.is_trivial_instanced_draw);
|
||||||
|
|
||||||
// Temp indirection table. Used to track "running" updates.
|
// Temp indirection table. Used to track "running" updates.
|
||||||
rsx::simple_array<u32> instancing_indirection_table;
|
auto& instancing_indirection_table = m_scratch_buffers.u32buf;
|
||||||
|
|
||||||
// indirection table size
|
// indirection table size
|
||||||
const auto full_reupload = !prog || prog->has_indexed_constants;
|
const auto full_reupload = !prog || prog->has_indexed_constants;
|
||||||
const auto reloc_table = full_reupload ? decltype(prog->constant_ids){} : prog->constant_ids;
|
const auto reloc_table = full_reupload ? decltype(prog->constant_ids){} : prog->constant_ids;
|
||||||
|
@ -767,7 +767,8 @@ namespace rsx
|
||||||
instancing_indirection_table.resize(redirection_table_size);
|
instancing_indirection_table.resize(redirection_table_size);
|
||||||
|
|
||||||
// Temp constants data
|
// Temp constants data
|
||||||
rsx::simple_array<u128> constants_data;
|
auto& constants_data = m_scratch_buffers.u128buf;
|
||||||
|
constants_data.clear();
|
||||||
constants_data.reserve(redirection_table_size * draw_call.pass_count());
|
constants_data.reserve(redirection_table_size * draw_call.pass_count());
|
||||||
|
|
||||||
// Allocate indirection buffer on GPU stream
|
// Allocate indirection buffer on GPU stream
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <util/types.hpp>
|
#include <util/types.hpp>
|
||||||
|
|
||||||
|
#include "Emu/RSX/Common/simple_array.hpp"
|
||||||
#include "Emu/RSX/Core/RSXVertexTypes.h"
|
#include "Emu/RSX/Core/RSXVertexTypes.h"
|
||||||
#include "Emu/RSX/NV47/FW/draw_call.hpp"
|
#include "Emu/RSX/NV47/FW/draw_call.hpp"
|
||||||
#include "Emu/RSX/Program/ProgramStateCache.h"
|
#include "Emu/RSX/Program/ProgramStateCache.h"
|
||||||
|
@ -28,6 +29,12 @@ namespace rsx
|
||||||
std::array<push_buffer_vertex_info, 16> m_vertex_push_buffers;
|
std::array<push_buffer_vertex_info, 16> m_vertex_push_buffers;
|
||||||
rsx::simple_array<u32> m_element_push_buffer;
|
rsx::simple_array<u32> m_element_push_buffer;
|
||||||
|
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
rsx::simple_array<u32> u32buf;
|
||||||
|
rsx::simple_array<u128> u128buf;
|
||||||
|
} mutable m_scratch_buffers;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
draw_command_processor() = default;
|
draw_command_processor() = default;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue