Merge branch 'master' into shader-decomp

This commit is contained in:
wheremyfoodat 2024-07-25 22:27:15 +03:00
commit 69accdec54
8 changed files with 34 additions and 26 deletions

View file

@ -35,9 +35,6 @@ namespace PICA {
BitField<0, 3, FogMode> mode;
BitField<3, 1, u32> flipDepth;
BitField<8, 8, u32> fogColorR;
BitField<16, 8, u32> fogColorG;
BitField<24, 8, u32> fogColorB;
};
};
@ -238,9 +235,6 @@ namespace PICA {
if (fogConfig.mode == FogMode::Fog) {
fogConfig.flipDepth = Helpers::getBit<16>(regs[InternalRegs::TexEnvUpdateBuffer]);
fogConfig.fogColorR = Helpers::getBits<0, 8>(regs[InternalRegs::FogColor]);
fogConfig.fogColorG = Helpers::getBits<8, 8>(regs[InternalRegs::FogColor]);
fogConfig.fogColorB = Helpers::getBits<16, 8>(regs[InternalRegs::FogColor]);
}
}
};

View file

@ -34,8 +34,10 @@ namespace PICA {
alignas(16) vec4 tevBufferColor;
alignas(16) vec4 clipCoords;
// Note: We upload this as a u32 and decode on GPU
// Note: We upload these as a u32 and decode on GPU.
// Particularly the fog colour since fog is really uncommon and it doesn't matter if we decode on GPU.
u32 globalAmbientLight;
u32 fogColor;
// NOTE: THIS MUST BE LAST so that if lighting is disabled we can potentially omit uploading it
LightUniform lightUniforms[8];
};

View file

@ -139,6 +139,7 @@ class MainWindow : public QMainWindow {
MainWindow(QApplication* app, QWidget* parent = nullptr);
~MainWindow();
void closeEvent(QCloseEvent *event) override;
void keyPressEvent(QKeyEvent* event) override;
void keyReleaseEvent(QKeyEvent* event) override;
void mousePressEvent(QMouseEvent* event) override;

View file

@ -76,11 +76,11 @@ class RendererGL final : public Renderer {
// The "default" vertex shader to use when using specialized shaders but not PICA vertex shader -> GLSL recompilation
// We can compile this once and then link it with all other generated fragment shaders
OpenGL::Shader defaultShadergenVs;
GLuint shadergenFragmentUBO;
// Cached recompiled fragment shader
struct CachedProgram {
OpenGL::Program program;
uint uboBinding;
};
struct ShaderCache {