|
|
@ -125,7 +125,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Verify that this actually modifies the register!
|
|
|
|
// TODO: Verify that this actually modifies the register!
|
|
|
|
if (setup.index < 15) {
|
|
|
|
if (setup.index < 15) {
|
|
|
|
g_state.vs_default_attributes[setup.index] = attribute;
|
|
|
|
g_state.input_default_attributes.attr[setup.index] = attribute;
|
|
|
|
setup.index++;
|
|
|
|
setup.index++;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
// Put each attribute into an immediate input buffer.
|
|
|
|
// Put each attribute into an immediate input buffer.
|
|
|
@ -138,7 +138,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|
|
|
|
|
|
|
|
|
|
|
immediate_input.attr[immediate_attribute_id++] = attribute;
|
|
|
|
immediate_input.attr[immediate_attribute_id++] = attribute;
|
|
|
|
|
|
|
|
|
|
|
|
if (immediate_attribute_id >= regs.vs.max_input_attribute_index + 1) {
|
|
|
|
if (immediate_attribute_id > regs.vs.max_input_attribute_index) {
|
|
|
|
MICROPROFILE_SCOPE(GPU_Drawing);
|
|
|
|
MICROPROFILE_SCOPE(GPU_Drawing);
|
|
|
|
immediate_attribute_id = 0;
|
|
|
|
immediate_attribute_id = 0;
|
|
|
|
|
|
|
|
|
|
|
@ -150,8 +150,7 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|
|
|
g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
|
|
|
|
g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
|
|
|
|
static_cast<void*>(&immediate_input));
|
|
|
|
static_cast<void*>(&immediate_input));
|
|
|
|
Shader::UnitState shader_unit;
|
|
|
|
Shader::UnitState shader_unit;
|
|
|
|
shader_unit.LoadInputVertex(immediate_input,
|
|
|
|
shader_unit.LoadInput(immediate_input, regs.vs.max_input_attribute_index + 1);
|
|
|
|
regs.vs.max_input_attribute_index + 1);
|
|
|
|
|
|
|
|
shader_engine->Run(g_state.vs, shader_unit);
|
|
|
|
shader_engine->Run(g_state.vs, shader_unit);
|
|
|
|
auto output_vertex = Shader::OutputVertex::FromRegisters(
|
|
|
|
auto output_vertex = Shader::OutputVertex::FromRegisters(
|
|
|
|
shader_unit.registers.output, regs, regs.vs.output_mask);
|
|
|
|
shader_unit.registers.output, regs, regs.vs.output_mask);
|
|
|
@ -281,14 +280,14 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) {
|
|
|
|
|
|
|
|
|
|
|
|
if (!vertex_cache_hit) {
|
|
|
|
if (!vertex_cache_hit) {
|
|
|
|
// Initialize data for the current vertex
|
|
|
|
// Initialize data for the current vertex
|
|
|
|
Shader::InputVertex input;
|
|
|
|
Shader::AttributeBuffer input;
|
|
|
|
loader.LoadVertex(base_address, index, vertex, input, memory_accesses);
|
|
|
|
loader.LoadVertex(base_address, index, vertex, input, memory_accesses);
|
|
|
|
|
|
|
|
|
|
|
|
// Send to vertex shader
|
|
|
|
// Send to vertex shader
|
|
|
|
if (g_debug_context)
|
|
|
|
if (g_debug_context)
|
|
|
|
g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
|
|
|
|
g_debug_context->OnEvent(DebugContext::Event::VertexShaderInvocation,
|
|
|
|
(void*)&input);
|
|
|
|
(void*)&input);
|
|
|
|
shader_unit.LoadInputVertex(input, loader.GetNumTotalAttributes());
|
|
|
|
shader_unit.LoadInput(input, loader.GetNumTotalAttributes());
|
|
|
|
shader_engine->Run(g_state.vs, shader_unit);
|
|
|
|
shader_engine->Run(g_state.vs, shader_unit);
|
|
|
|
|
|
|
|
|
|
|
|
// Retrieve vertex from register data
|
|
|
|
// Retrieve vertex from register data
|
|
|
|