[PICA] We can now upload floating point uniforms

This commit is contained in:
wheremyfoodat 2022-09-23 14:15:04 +03:00
parent a7bde80658
commit 92b7ca3b8c
6 changed files with 94 additions and 23 deletions

View file

@ -54,6 +54,16 @@ void GPU::writeInternalReg(u32 index, u32 value, u32 mask) {
fixedAttribMask = (value >> 16) & 0xfff; // Determines which vertex attributes are fixed for all vertices
break;
case VertexFloatUniformIndex:
shaderUnit.vs.setFloatUniformIndex(value);
break;
case VertexFloatUniformData0: case VertexFloatUniformData1: case VertexFloatUniformData2:
case VertexFloatUniformData3: case VertexFloatUniformData4: case VertexFloatUniformData5:
case VertexFloatUniformData6: case VertexFloatUniformData7:
shaderUnit.vs.uploadFloatUniform(value);
break;
case FixedAttribIndex:
fixedAttribCount = 0;
fixedAttribIndex = value & 0xf;

View file

@ -3,4 +3,24 @@
void ShaderUnit::reset() {
vs.reset();
gs.reset();
}
void PICAShader::reset() {
loadedShader.fill(0);
bufferedShader.fill(0);
operandDescriptors.fill(0);
intUniforms.fill(0);
boolUniform = 0;
bufferIndex = 0;
floatUniformIndex = 0;
floatUniformWordCount = 0;
opDescriptorIndex = 0;
f32UniformTransfer = false;
const vec4f zero = vec4f({ f24::fromFloat32(0.0), f24::fromFloat32(0.0), f24::fromFloat32(0.0), f24::fromFloat32(0.0) });
attributes.fill(zero);
floatUniforms.fill(zero);
outputs.fill(zero);
tempRegisters.fill(zero);
}