mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-22 19:00:14 -05:00
Shader Debugger: Fix only first vertex attribute being loaded
This commit is contained in:
parent
c1beb2ce20
commit
f77dfb3966
1 changed files with 7 additions and 7 deletions
|
@ -475,6 +475,7 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d
|
||||||
auto& shader_config = Pica::g_state.regs.vs;
|
auto& shader_config = Pica::g_state.regs.vs;
|
||||||
for (auto instr : shader_setup.program_code)
|
for (auto instr : shader_setup.program_code)
|
||||||
info.code.push_back({instr});
|
info.code.push_back({instr});
|
||||||
|
int num_attributes = Pica::g_state.regs.vertex_attributes.GetNumTotalAttributes();
|
||||||
|
|
||||||
for (auto pattern : shader_setup.swizzle_data)
|
for (auto pattern : shader_setup.swizzle_data)
|
||||||
info.swizzle_info.push_back({pattern});
|
info.swizzle_info.push_back({pattern});
|
||||||
|
@ -483,19 +484,18 @@ void GraphicsVertexShaderWidget::Reload(bool replace_vertex_data, void* vertex_d
|
||||||
info.labels.insert({ entry_point, "main" });
|
info.labels.insert({ entry_point, "main" });
|
||||||
|
|
||||||
// Generate debug information
|
// Generate debug information
|
||||||
debug_data = Pica::Shader::ProduceDebugInfo(input_vertex, 1, shader_config, shader_setup);
|
debug_data = Pica::Shader::ProduceDebugInfo(input_vertex, num_attributes, shader_config, shader_setup);
|
||||||
|
|
||||||
// Reload widget state
|
// Reload widget state
|
||||||
|
for (unsigned int attr = 0; attr < num_attributes; ++attr) {
|
||||||
// Only show input attributes which are used as input to the shader
|
|
||||||
for (unsigned int attr = 0; attr < 16; ++attr) {
|
|
||||||
input_data_container[attr]->setVisible(false);
|
|
||||||
}
|
|
||||||
for (unsigned int attr = 0; attr < Pica::g_state.regs.vertex_attributes.GetNumTotalAttributes(); ++attr) {
|
|
||||||
unsigned source_attr = shader_config.input_register_map.GetRegisterForAttribute(attr);
|
unsigned source_attr = shader_config.input_register_map.GetRegisterForAttribute(attr);
|
||||||
input_data_mapping[source_attr]->setText(QString("-> v%1").arg(attr));
|
input_data_mapping[source_attr]->setText(QString("-> v%1").arg(attr));
|
||||||
input_data_container[source_attr]->setVisible(true);
|
input_data_container[source_attr]->setVisible(true);
|
||||||
}
|
}
|
||||||
|
// Only show input attributes which are used as input to the shader
|
||||||
|
for (unsigned int attr = num_attributes; attr < 16; ++attr) {
|
||||||
|
input_data_container[attr]->setVisible(false);
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize debug info text for current cycle count
|
// Initialize debug info text for current cycle count
|
||||||
cycle_index->setMaximum(debug_data.records.size() - 1);
|
cycle_index->setMaximum(debug_data.records.size() - 1);
|
||||||
|
|
Loading…
Reference in a new issue