This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void RasterizerOpenGL::SyncLightPosition(int light_index) { | |
GLvec3 position = { | |
Pica::float16::FromRaw(Pica::g_state.regs.lighting.light[light_index].x).ToFloat32(), | |
Pica::float16::FromRaw(Pica::g_state.regs.lighting.light[light_index].y).ToFloat32(), | |
Pica::float16::FromRaw(Pica::g_state.regs.lighting.light[light_index].z).ToFloat32()}; | |
if (position != uniform_block_data.data.light_src[light_index].position) { | |
uniform_block_data.data.light_src[light_index].position = position; | |
uniform_block_data.dirty = true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/video_core/swrasterizer/rasterizer.cpp b/src/video_core/swrasterizer/rasterizer.cpp | |
index a0ce851..c227092 100644 | |
--- a/src/video_core/swrasterizer/rasterizer.cpp | |
+++ b/src/video_core/swrasterizer/rasterizer.cpp | |
@@ -116,19 +116,22 @@ static std::tuple<float24, float24, PAddr> ConvertCubeCoord(float24 u, float24 v | |
} | |
-float LookupLightingLut(size_t lut_index, float index) { | |
- index *= 256; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/video_core/swrasterizer/framebuffer.cpp b/src/video_core/swrasterizer/framebuffer.cpp | |
index 7de3aac..3f5906a 100644 | |
--- a/src/video_core/swrasterizer/framebuffer.cpp | |
+++ b/src/video_core/swrasterizer/framebuffer.cpp | |
@@ -280,17 +280,17 @@ Math::Vec4<u8> EvaluateBlendEquation(const Math::Vec4<u8>& src, const Math::Vec4 | |
// TODO: How do these two actually work? OpenGL doesn't include the blend factors in the | |
// min/max computations, but is this what the 3DS actually does? | |
case FramebufferRegs::BlendEquation::Min: | |
- result.r() = std::min(src.r(), dest.r()); | |
- result.g() = std::min(src.g(), dest.g()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void sceneRender1(void) | |
{ | |
// Update the uniforms | |
float zeros[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | |
GPUCMD_AddWrite(GPUREG_VSH_FLOATUNIFORM_CONFIG, 0x80000000|uLoc_projection1); | |
GPUCMD_AddWrites(GPUREG_VSH_FLOATUNIFORM_DATA, (u32*)&zeros, 4); | |
GPUCMD_AddWrite(GPUREG_VSH_FLOATUNIFORM_CONFIG, 0x80000000|(uLoc_projection1 + 1)); | |
GPUCMD_AddWrites(GPUREG_VSH_FLOATUNIFORM_DATA, (u32*)&projection1 + 4, 12); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp | |
index 4633a1d..15894e6 100644 | |
--- a/src/video_core/command_processor.cpp | |
+++ b/src/video_core/command_processor.cpp | |
@@ -349,7 +351,11 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { | |
vertex_cache_ids.fill(-1); | |
auto* shader_engine = Shader::GetEngine(); | |
- Shader::UnitState shader_unit; | |
+ static Shader::UnitState shader_units[4] = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Example PICA200 vertex shader | |
; Uniforms | |
.fvec projection[4] | |
; Constants | |
.constf myconst(0.0, 1.0, 0.0, 1.0) | |
.constf myconst2(1.0, 2.0, 3.0, 0.0) | |
.constf outofbounds(96.0, 0.0, 0.0, 0.0) | |
.alias zeros myconst.xxxx ; Vector full of zeros |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Example PICA200 vertex shader | |
; Uniforms | |
.fvec projection[4] | |
; Constants | |
.constf myconst(0.0, 1.0, 0.0, 1.0) | |
.constf myconst2(1.0, 2.0, 3.0, 0.0) | |
.constf outofbounds(96.0, 0.0, 0.0, 0.0) | |
.alias zeros myconst.xxxx ; Vector full of zeros |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main: | |
if my_bool: | |
mov r7.xyzw, some_const.xyzw | |
mov o0.xyzw, white.xyzw | |
else: | |
mov o0.xyzw, r7.xyzw | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <3ds.h> | |
#include <citro3d.h> | |
#include <string.h> | |
#include <stdio.h> | |
#include "vshader_shbin.h" | |
#define CLEAR_COLOR 0x68B0D8FF | |
#define DISPLAY_TRANSFER_FLAGS \ | |
(GX_TRANSFER_FLIP_VERT(0) | GX_TRANSFER_OUT_TILED(0) | GX_TRANSFER_RAW_COPY(0) | \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import imutils | |
import time | |
import cv2 | |
from picamera.array import PiRGBArray | |
from picamera import PiCamera | |
import datetime | |
import RPi.GPIO as GPIO | |
import numpy as np | |