mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-03-14 01:27:00 +00:00
rsx: Move inline array to draw_clause structure.
This commit is contained in:
parent
ce21db2ce3
commit
03c86ae43b
@ -347,10 +347,12 @@ std::tuple<bool, size_t, std::vector<D3D12_SHADER_RESOURCE_VIEW_DESC>> D3D12GSRe
|
||||
{
|
||||
size_t vertex_count;
|
||||
std::vector<D3D12_SHADER_RESOURCE_VIEW_DESC> vertex_buffer_view;
|
||||
std::tie(vertex_buffer_view, vertex_count) = upload_inlined_vertex_array(
|
||||
rsx::method_registers.vertex_arrays_info,
|
||||
{ (const gsl::byte*) inline_vertex_array.data(), ::narrow<int>(inline_vertex_array.size() * sizeof(uint)) },
|
||||
m_buffer_data, m_vertex_buffer_data.Get(), command_list);
|
||||
std::tie(vertex_buffer_view, vertex_count) =
|
||||
upload_inlined_vertex_array(rsx::method_registers.vertex_arrays_info,
|
||||
{(const gsl::byte*)rsx::method_registers.current_draw_clause.inline_vertex_array.data(),
|
||||
::narrow<int>(rsx::method_registers.current_draw_clause.inline_vertex_array.size() *
|
||||
sizeof(uint))},
|
||||
m_buffer_data, m_vertex_buffer_data.Get(), command_list);
|
||||
|
||||
if (is_primitive_native(rsx::method_registers.current_draw_clause.primitive))
|
||||
return std::make_tuple(false, vertex_count, vertex_buffer_view);
|
||||
|
@ -418,7 +418,9 @@ u32 GLGSRender::upload_inline_array(const u32 &max_vertex_attrib_size, const u32
|
||||
stride += rsx::get_vertex_type_size_on_host(info.type(), info.size());
|
||||
}
|
||||
|
||||
u32 vertex_draw_count = (u32)(inline_vertex_array.size() * sizeof(u32)) / stride;
|
||||
u32 vertex_draw_count =
|
||||
(u32)(rsx::method_registers.current_draw_clause.inline_vertex_array.size() * sizeof(u32)) /
|
||||
stride;
|
||||
m_attrib_ring_buffer.reserve_and_map(vertex_draw_count * max_vertex_attrib_size);
|
||||
|
||||
for (int index = 0; index < rsx::limits::vertex_count; ++index)
|
||||
@ -443,7 +445,8 @@ u32 GLGSRender::upload_inline_array(const u32 &max_vertex_attrib_size, const u32
|
||||
|
||||
auto &texture = m_gl_attrib_buffers[index];
|
||||
|
||||
u8 *src = reinterpret_cast<u8*>(inline_vertex_array.data());
|
||||
u8* src =
|
||||
reinterpret_cast<u8*>(rsx::method_registers.current_draw_clause.inline_vertex_array.data());
|
||||
auto mapping = m_attrib_ring_buffer.alloc_from_reserve(data_size, m_min_texbuffer_alignment);
|
||||
u8 *dst = static_cast<u8*>(mapping.first);
|
||||
|
||||
|
@ -327,7 +327,7 @@ namespace rsx
|
||||
|
||||
void thread::begin()
|
||||
{
|
||||
inline_vertex_array.clear();
|
||||
rsx::method_registers.current_draw_clause.inline_vertex_array.clear();
|
||||
}
|
||||
|
||||
void thread::end()
|
||||
@ -521,11 +521,13 @@ namespace rsx
|
||||
|
||||
void thread::write_inline_array_to_buffer(void *dst_buffer)
|
||||
{
|
||||
u8* src = reinterpret_cast<u8*>(inline_vertex_array.data());
|
||||
u8* src =
|
||||
reinterpret_cast<u8*>(rsx::method_registers.current_draw_clause.inline_vertex_array.data());
|
||||
u8* dst = (u8*)dst_buffer;
|
||||
|
||||
size_t bytes_written = 0;
|
||||
while (bytes_written < inline_vertex_array.size() * sizeof(u32))
|
||||
while (bytes_written <
|
||||
rsx::method_registers.current_draw_clause.inline_vertex_array.size() * sizeof(u32))
|
||||
{
|
||||
for (int index = 0; index < rsx::limits::vertex_count; ++index)
|
||||
{
|
||||
|
@ -183,8 +183,6 @@ namespace rsx
|
||||
u32 local_mem_addr, main_mem_addr;
|
||||
bool strict_ordering[0x1000];
|
||||
|
||||
std::vector<u32> inline_vertex_array;
|
||||
|
||||
bool m_rtts_dirty;
|
||||
bool m_transform_constants_dirty;
|
||||
bool m_textures_dirty[16];
|
||||
|
@ -394,7 +394,9 @@ u32 VKGSRender::upload_inlined_array()
|
||||
stride += rsx::get_vertex_type_size_on_host(info.type(), info.size());
|
||||
}
|
||||
|
||||
u32 vertex_draw_count = (u32)(inline_vertex_array.size() * sizeof(u32)) / stride;
|
||||
u32 vertex_draw_count =
|
||||
(u32)(rsx::method_registers.current_draw_clause.inline_vertex_array.size() * sizeof(u32)) /
|
||||
stride;
|
||||
|
||||
for (int index = 0; index < rsx::limits::vertex_count; ++index)
|
||||
{
|
||||
@ -413,7 +415,8 @@ u32 VKGSRender::upload_inlined_array()
|
||||
const VkFormat format = vk::get_suitable_vk_format(vertex_info.type(), vertex_info.size());
|
||||
|
||||
u32 offset_in_attrib_buffer = m_attrib_ring_info.alloc<256>(data_size);
|
||||
u8 *src = reinterpret_cast<u8*>(inline_vertex_array.data());
|
||||
u8* src =
|
||||
reinterpret_cast<u8*>(rsx::method_registers.current_draw_clause.inline_vertex_array.data());
|
||||
u8 *dst = static_cast<u8*>(m_attrib_ring_info.map(offset_in_attrib_buffer, data_size));
|
||||
|
||||
src += offsets[index];
|
||||
|
@ -206,7 +206,7 @@ namespace rsx
|
||||
void draw_inline_array(thread* rsx, u32 _reg, u32 arg)
|
||||
{
|
||||
rsx::method_registers.current_draw_clause.command = rsx::draw_command::inlined_array;
|
||||
rsx->inline_vertex_array.push_back(arg);
|
||||
rsx::method_registers.current_draw_clause.inline_vertex_array.push_back(arg);
|
||||
}
|
||||
|
||||
template<u32 index>
|
||||
@ -269,7 +269,8 @@ namespace rsx
|
||||
rsx::method_registers.current_draw_clause.first_count_commands.push_back(std::make_pair(0, max_vertex_count));
|
||||
}
|
||||
|
||||
if (!(rsx::method_registers.current_draw_clause.first_count_commands.empty() && rsxthr->inline_vertex_array.empty()))
|
||||
if (!(rsx::method_registers.current_draw_clause.first_count_commands.empty() &&
|
||||
rsx::method_registers.current_draw_clause.inline_vertex_array.empty()))
|
||||
{
|
||||
rsxthr->end();
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ namespace rsx
|
||||
primitive_type primitive;
|
||||
draw_command command;
|
||||
|
||||
std::vector<u32> inline_vertex_array;
|
||||
|
||||
/**
|
||||
* Stores the first and count argument from draw/draw indexed parameters between begin/end clauses.
|
||||
*/
|
||||
|
Loading…
x
Reference in New Issue
Block a user