rsx: Fix vertex input detection

- Properly detect inline array registers vs constant value registers
- Silence needless spam, 306E is 2D surface engiine, the assumption that y is multiplied by 306E pitch is not crazy
This commit is contained in:
kd-11 2018-04-01 13:18:57 +03:00
parent 53f2533a08
commit 93b2776604
2 changed files with 25 additions and 21 deletions

View File

@ -1389,25 +1389,33 @@ namespace rsx
if (!enabled) if (!enabled)
continue; continue;
if (vertex_push_buffers[index].size > 0) //Check for interleaving
const auto &info = state.vertex_arrays_info[index];
if (rsx::method_registers.current_draw_clause.is_immediate_draw)
{ {
if (vertex_push_buffers[index].vertex_count > 1)
{
//Read temp buffer (register array)
std::pair<u8, u32> volatile_range_info = std::make_pair(index, static_cast<u32>(vertex_push_buffers[index].data.size() * sizeof(u32))); std::pair<u8, u32> volatile_range_info = std::make_pair(index, static_cast<u32>(vertex_push_buffers[index].data.size() * sizeof(u32)));
result.volatile_blocks.push_back(volatile_range_info); result.volatile_blocks.push_back(volatile_range_info);
result.attribute_placement[index] = attribute_buffer_placement::transient; result.attribute_placement[index] = attribute_buffer_placement::transient;
continue; continue;
} }
//Check for interleaving //Might be an indexed immediate draw - real vertex arrays but glArrayElement style of IB declaration
auto &info = state.vertex_arrays_info[index]; }
if (info.size() == 0 && state.register_vertex_info[index].size > 0)
if (!info.size())
{
if (state.register_vertex_info[index].size > 0)
{ {
//Reads from register //Reads from register
result.referenced_registers.push_back(index); result.referenced_registers.push_back(index);
result.attribute_placement[index] = attribute_buffer_placement::transient; result.attribute_placement[index] = attribute_buffer_placement::transient;
continue; continue;
} }
}
if (info.size() > 0) else
{ {
result.attribute_placement[index] = attribute_buffer_placement::persistent; result.attribute_placement[index] = attribute_buffer_placement::persistent;
const u32 base_address = info.offset() & 0x7fffffff; const u32 base_address = info.offset() & 0x7fffffff;
@ -1990,7 +1998,8 @@ namespace rsx
//Data is either from an immediate render or register input //Data is either from an immediate render or register input
//Immediate data overrides register input //Immediate data overrides register input
if (rsx::method_registers.current_draw_clause.is_immediate_draw && vertex_push_buffers[index].size > 0) if (rsx::method_registers.current_draw_clause.is_immediate_draw &&
vertex_push_buffers[index].vertex_count > 1)
{ {
const auto &info = rsx::method_registers.register_vertex_info[index]; const auto &info = rsx::method_registers.register_vertex_info[index];
type = info.type; type = info.type;

View File

@ -561,11 +561,6 @@ namespace rsx
u16 x = method_registers.nv308a_x(); u16 x = method_registers.nv308a_x();
u16 y = method_registers.nv308a_y(); u16 y = method_registers.nv308a_y();
if (y)
{
LOG_ERROR(RSX, "%s: y is not null (0x%x)", __FUNCTION__, y);
}
const u32 pixel_offset = (method_registers.blit_engine_output_pitch_nv3062() * y) + (x << 2); const u32 pixel_offset = (method_registers.blit_engine_output_pitch_nv3062() * y) + (x << 2);
u32 address = get_address(method_registers.blit_engine_output_offset_nv3062() + pixel_offset + index * 4, method_registers.blit_engine_output_location_nv3062()); u32 address = get_address(method_registers.blit_engine_output_offset_nv3062() + pixel_offset + index * 4, method_registers.blit_engine_output_location_nv3062());
vm::write32(address, arg); vm::write32(address, arg);