yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Maxwell3D: Process Macros on MultiMethod.

This commit is contained in:
Fernando Sahmkow 2020-04-20 12:27:57 -04:00
parent 3fedcc2f6e
commit 18a88d19dc
1 changed files with 47 additions and 25 deletions

View File

@ -280,7 +280,30 @@ void Maxwell3D::CallMethod(const GPU::MethodCall& method_call) {
}
}
void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, u32 methods_pending) {
void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount,
u32 methods_pending) {
// Methods after 0xE00 are special, they're actually triggers for some microcode that was
// uploaded to the GPU during initialization.
if (method >= MacroRegistersStart) {
// We're trying to execute a macro
if (executing_macro == 0) {
// A macro call must begin by writing the macro method's register, not its argument.
ASSERT_MSG((method % 2) == 0,
"Can't start macro execution by writing to the ARGS register");
executing_macro = method;
}
for (std::size_t i = 0; i < amount; i++) {
macro_params.push_back(base_start[i]);
}
// Call the macro when there are no more parameters in the command buffer
if (amount == methods_pending) {
CallMacroMethod(executing_macro, macro_params.size(), macro_params.data());
macro_params.clear();
}
return;
}
switch (method) {
case MAXWELL3D_REG_INDEX(const_buffer.cb_data[0]):
case MAXWELL3D_REG_INDEX(const_buffer.cb_data[1]):
@ -307,7 +330,6 @@ void Maxwell3D::CallMultiMethod(u32 method, const u32* base_start, u32 amount, u
}
}
}
}
void Maxwell3D::StepInstance(const MMEDrawMode expected_mode, const u32 count) {