Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove shader-related hallucinations #550

Merged
merged 1 commit into from
Jul 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions include/PICA/shader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,9 @@ class PICAShader {
public:
static constexpr size_t maxInstructionCount = 4096;
std::array<u32, maxInstructionCount> loadedShader; // Currently loaded & active shader
std::array<u32, maxInstructionCount> bufferedShader; // Shader to be transferred when the SH_CODETRANSFER_END reg gets written to

PICAShader(ShaderType type) : type(type) {}

// Theese functions are in the header to be inlined more easily, though with LTO I hope I'll be able to move them
void finalize() { std::memcpy(&loadedShader[0], &bufferedShader[0], 4096 * sizeof(u32)); }

void setBufferIndex(u32 index) { bufferIndex = index & 0xfff; }
void setOpDescriptorIndex(u32 index) { opDescriptorIndex = index & 0x7f; }

Expand All @@ -235,7 +231,7 @@ class PICAShader {
Helpers::panic("o no, shader upload overflew");
}

bufferedShader[bufferIndex++] = word;
loadedShader[bufferIndex++] = word;
bufferIndex &= 0xfff;

codeHashDirty = true; // Signal the JIT if necessary that the program hash has potentially changed
Expand Down
2 changes: 2 additions & 0 deletions src/core/PICA/regs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,9 +329,11 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
break;
}

/* TODO: Find out if this actually does anything
case VertexShaderTransferEnd:
if (value != 0) shaderUnit.vs.finalize();
break;
*/

case VertexShaderTransferIndex: shaderUnit.vs.setBufferIndex(value); break;

Expand Down
1 change: 0 additions & 1 deletion src/core/PICA/shader_unit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ void ShaderUnit::reset() {

void PICAShader::reset() {
loadedShader.fill(0);
bufferedShader.fill(0);
operandDescriptors.fill(0);

boolUniform = 0;
Expand Down
Loading