[PICA] We now know how to convert attributes to f32
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
#include "PICA/gpu.hpp"
|
||||
#include "PICA/float_types.hpp"
|
||||
#include "PICA/regs.hpp"
|
||||
#include <cstdio>
|
||||
|
||||
using namespace Floats;
|
||||
|
||||
void GPU::reset() {
|
||||
regs.fill(0);
|
||||
shaderUnit.reset();
|
||||
@@ -16,5 +19,13 @@ void GPU::drawArrays() {
|
||||
const u32 vertexCount = regs[PICAInternalRegs::VertexCountReg];
|
||||
const u32 vertexOffset = regs[PICAInternalRegs::VertexOffsetReg];
|
||||
|
||||
|
||||
u32* attrBuffer = ®s[0x233];
|
||||
auto a = f24::fromRaw(attrBuffer[0] >> 8);
|
||||
auto b = f24::fromRaw(((attrBuffer[0] & 0xFF) << 16) | ((attrBuffer[1] >> 16) & 0xFFFF));
|
||||
auto g = f24::fromRaw(((attrBuffer[1] & 0xFFFF) << 8) | ((attrBuffer[2] >> 24) & 0xFF));
|
||||
auto r = f24::fromRaw(attrBuffer[2] & 0xFFFFFF);
|
||||
|
||||
printf("PICA::DrawArrays(vertex count = %d, vertexOffset = %d)\n", vertexCount, vertexOffset);
|
||||
printf("(r: %f, g: %f, b: %f, a: %f)\n", r.toFloat32(), g.toFloat32(), b.toFloat32(), a.toFloat32());
|
||||
}
|
||||
Reference in New Issue
Block a user