[WIP] rsx: Rebase cleanup

This commit is contained in:
kd-11 2018-11-09 17:57:07 +03:00 committed by kd-11
commit 833c25894f
7 changed files with 40 additions and 44 deletions

View file

@ -118,7 +118,7 @@ namespace rsx
return;
}
if (UNLIKELY(cmd & 0xe0030003))
if (UNLIKELY(cmd & RSX_METHOD_NON_METHOD_CMD_MASK))
{
if ((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD ||
(cmd & RSX_METHOD_NEW_JUMP_CMD_MASK) == RSX_METHOD_NEW_JUMP_CMD ||
@ -344,31 +344,41 @@ namespace rsx
fifo_ctrl->read(command);
const auto cmd = command.reg;
if (cmd == FIFO::FIFO_BUSY)
if (UNLIKELY(cmd & (0xffff0000 | RSX_METHOD_NON_METHOD_CMD_MASK)))
{
// Do something else
return;
}
// Check for special FIFO commands
switch (cmd)
{
case FIFO::FIFO_EMPTY:
{
if (performance_counters.state == FIFO_state::running)
{
performance_counters.FIFO_idle_timestamp = get_system_time();
performance_counters.state = FIFO_state::empty;
}
else
{
std::this_thread::yield();
}
if (cmd == FIFO::FIFO_EMPTY)
{
if (performance_counters.state == FIFO_state::running)
{
performance_counters.FIFO_idle_timestamp = get_system_time();
performance_counters.state = FIFO_state::empty;
return;
}
else
case FIFO::FIFO_BUSY:
{
std::this_thread::yield();
// Do something else
return;
}
case FIFO::FIFO_ERROR:
{
// Error. Should reset the queue
// TODO
LOG_ERROR(RSX, "FIFO error: possible desync event");
std::this_thread::sleep_for(1ms);
return;
}
}
return;
}
// Validate put and get registers before reading the command
// TODO: Who should handle graphics exceptions??
if (UNLIKELY(cmd & 0xe0030003))
{
// Check for flow control
if ((cmd & RSX_METHOD_OLD_JUMP_CMD_MASK) == RSX_METHOD_OLD_JUMP_CMD)
{
const u32 offs = cmd & 0x1ffffffc;
@ -434,7 +444,8 @@ namespace rsx
return;
}
fmt::throw_exception("Unreachable" HERE);
// If we reached here, this is likely an error
fmt::throw_exception("Unexpected command 0x%x" HERE, cmd);
}
else if (cmd == RSX_METHOD_NOP_CMD)
{

View file

@ -3,7 +3,7 @@
#include <Utilities/types.h>
#include <Utilities/Atomic.h>
#include <Utilities/mutex.h>
#include <Utilities/thread.h>
#include <Utilities/Thread.h>
#include "rsx_utils.h"

View file

@ -667,24 +667,6 @@ namespace rsx
void thread::on_exit()
{
m_rsx_thread_exiting = true;
if (m_vblank_thread)
{
m_vblank_thread->join();
m_vblank_thread.reset();
}
if (m_decompiler_thread)
{
m_decompiler_thread->join();
m_decompiler_thread.reset();
}
}
std::string thread::get_name() const
{
return "rsx::thread";
>>>>>>> rsx: Fixups
}
void thread::fill_scale_offset_data(void *buffer, bool flip_y) const
@ -2070,6 +2052,9 @@ namespace rsx
else
{
// Array
type = info.type();
size = info.size();
attrib0 = layout.interleaved_blocks[0].attribute_stride | default_frequency_mask;
}
}

View file

@ -105,7 +105,7 @@ void VKFragmentDecompilerThread::insertOutputs(std::stringstream & OS)
void VKFragmentDecompilerThread::insertConstants(std::stringstream & OS)
{
int location = TEXTURES_FIRST_BIND_SLOT;
u32 location = TEXTURES_FIRST_BIND_SLOT;
for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM])
{
if (PT.type != "sampler1D" &&

View file

@ -2761,7 +2761,7 @@ public:
bound_buffer as_buffer;
bound_sampler as_sampler;
int location;
u32 location;
std::string name;
};

View file

@ -123,7 +123,7 @@ namespace vk
for (u32 n = 1; n <= m_num_usable_samplers; ++n)
{
fs_inputs.push_back({ ::glsl::program_domain::glsl_fragment_program, vk::glsl::program_input_type::input_type_texture,{},{}, s32(n), "fs" + std::to_string(n-1) });
fs_inputs.push_back({ ::glsl::program_domain::glsl_fragment_program, vk::glsl::program_input_type::input_type_texture,{},{}, n, "fs" + std::to_string(n-1) });
}
return fs_inputs;

View file

@ -94,7 +94,7 @@ void VKVertexDecompilerThread::insertConstants(std::stringstream & OS, const std
inputs.push_back(in);
int location = VERTEX_TEXTURES_FIRST_BIND_SLOT;
u32 location = VERTEX_TEXTURES_FIRST_BIND_SLOT;
for (const ParamType &PT : constants)
{
for (const ParamItem &PI : PT.items)