From 4868eebcd284a11e4ea8690340fb1b5fd42b4353 Mon Sep 17 00:00:00 2001 From: wheremyfoodat Date: Sat, 24 Sep 2022 02:58:16 +0300 Subject: [PATCH] [PICA] Short attributes --- src/core/PICA/gpu.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/core/PICA/gpu.cpp b/src/core/PICA/gpu.cpp index f382a8bf..0acc168b 100644 --- a/src/core/PICA/gpu.cpp +++ b/src/core/PICA/gpu.cpp @@ -96,6 +96,15 @@ void GPU::drawArrays() { uint component; // Current component switch (attribType) { + case 2: { // Short + s16* ptr = getPointerPhys(attrAddress); + for (component = 0; component < componentCount; component++) { + float val = static_cast(*ptr++); + attribute[component] = f24::fromFloat32(val); + } + break; + } + case 3: { // Float float* ptr = getPointerPhys(attrAddress); for (component = 0; component < componentCount; component++) { @@ -105,7 +114,7 @@ void GPU::drawArrays() { break; } - default: Helpers::panic("[PICA] Unimplemented component type %d", attribType); + default: Helpers::panic("[PICA] Unimplemented attribute type %d", attribType); } // Fill the remaining attribute lanes with default parameters (1.0 for alpha/w, 0.0) for everything else