[PICA] Implement int uniforms

This commit is contained in:
wheremyfoodat 2022-09-25 17:45:59 +03:00
parent 4cda023c22
commit a5c6fb858f
5 changed files with 25 additions and 3 deletions

View file

@ -100,6 +100,10 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
shaderUnit.vs.uploadDescriptor(value);
break;
case VertexIntUniform0: case VertexIntUniform1: case VertexIntUniform2: case VertexIntUniform3:
shaderUnit.vs.uploadIntUniform(index - VertexIntUniform0, value);
break;
case VertexShaderTransferEnd:
if (value != 0) shaderUnit.vs.finalize();
break;

View file

@ -1,7 +1,7 @@
#include "PICA/shader.hpp"
void PICAShader::run() {
u32 pc = 0; // Program counter
pc = 0;
while (true) {
const u32 instruction = loadedShader[pc++];

View file

@ -10,7 +10,6 @@ void PICAShader::reset() {
bufferedShader.fill(0);
operandDescriptors.fill(0);
intUniforms.fill(0);
boolUniform = 0;
bufferIndex = 0;
floatUniformIndex = 0;
@ -24,6 +23,10 @@ void PICAShader::reset() {
outputs.fill(zero);
tempRegisters.fill(zero);
for (auto& e : intUniforms) {
e.x() = e.y() = e.z() = e.w() = 0;
}
addrRegister.x() = 0;
addrRegister.y() = 0;
loopCounter = 0;