rsx: Improve inlined arrays (#5248)

* rsx: Implement register reads in inlined arrays

* rsx: Check for disabled streams in inlined arrays
This commit is contained in:
elad 2018-10-20 16:00:53 +03:00 committed by kd-11
parent f588454d26
commit 6829fa0286
1 changed files with 32 additions and 4 deletions

View File

@ -1789,11 +1789,20 @@ namespace rsx
{
auto &vinfo = state.vertex_arrays_info[index];
if (input_mask & (1u << index))
{
result.attribute_placement[index] = attribute_buffer_placement::transient;
}
if (vinfo.size() > 0)
{
info.locations.push_back(index);
info.attribute_stride += rsx::get_vertex_type_size_on_host(vinfo.type(), vinfo.size());
result.attribute_placement[index] = attribute_buffer_placement::transient;
}
else if (state.register_vertex_info[index].size > 0)
{
//Reads from register
result.referenced_registers.push_back(index);
}
}
@ -2326,7 +2335,7 @@ namespace rsx
if (rsx::method_registers.current_draw_clause.command == rsx::draw_command::inlined_array)
{
const auto &block = layout.interleaved_blocks[0];
u32 inline_data_offset = volatile_offset_base;
u32 inline_data_offset = volatile_offset;
for (const u8 index : block.locations)
{
auto &info = rsx::method_registers.vertex_arrays_info[index];
@ -2398,9 +2407,22 @@ namespace rsx
auto &info = rsx::method_registers.vertex_arrays_info[index];
type = info.type();
size = info.size();
if (!size)
{
// Register
const auto& reginfo = rsx::method_registers.register_vertex_info[index];
type = reginfo.type;
size = reginfo.size;
attributes = layout.interleaved_blocks[0].attribute_stride;
attributes |= default_frequency_mask | volatile_storage_mask;
attributes = rsx::get_vertex_type_size_on_host(type, size);
attributes |= volatile_storage_mask;
}
else
{
attributes = layout.interleaved_blocks[0].attribute_stride;
attributes |= default_frequency_mask | volatile_storage_mask;
}
}
else
{
@ -2499,6 +2521,12 @@ namespace rsx
{
if (draw_call.command == rsx::draw_command::inlined_array)
{
for (const u8 index : layout.referenced_registers)
{
memcpy(transient, rsx::method_registers.register_vertex_info[index].data.data(), 16);
transient += 16;
}
memcpy(transient, draw_call.inline_vertex_array.data(), draw_call.inline_vertex_array.size() * sizeof(u32));
//Is it possible to reference data outside of the inlined array?
return;