mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-12 09:09:47 +12:00
More whoopsies???!?
This commit is contained in:
parent
5e0fceef63
commit
f49a101170
4 changed files with 5 additions and 7 deletions
|
@ -14,7 +14,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
set(CMAKE_BUILD_TYPE RelWithDebInfo)
|
set(CMAKE_BUILD_TYPE Release)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(Alber)
|
project(Alber)
|
||||||
|
|
|
@ -25,7 +25,7 @@ class GPU;
|
||||||
|
|
||||||
// Cached recompiled fragment shader
|
// Cached recompiled fragment shader
|
||||||
struct CachedProgram {
|
struct CachedProgram {
|
||||||
OpenGL::Program program;
|
OpenGL::Program program {};
|
||||||
GLuint uboBinding = 0;
|
GLuint uboBinding = 0;
|
||||||
bool ready = false;
|
bool ready = false;
|
||||||
};
|
};
|
||||||
|
|
|
@ -82,8 +82,7 @@ void AsyncCompilerState::Start() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Sleep for a bit to avoid excessive CPU usage
|
std::this_thread::yield();
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Frontend::AsyncCompiler::destroyContext(contextCreationUserdata, context);
|
Frontend::AsyncCompiler::destroyContext(contextCreationUserdata, context);
|
||||||
|
|
|
@ -27,6 +27,7 @@ namespace {
|
||||||
|
|
||||||
void initializeProgramEntry(GLStateManager& gl, CachedProgram& programEntry) {
|
void initializeProgramEntry(GLStateManager& gl, CachedProgram& programEntry) {
|
||||||
OpenGL::Program& program = programEntry.program;
|
OpenGL::Program& program = programEntry.program;
|
||||||
|
program.use();
|
||||||
|
|
||||||
// Init sampler objects. Texture 0 goes in texture unit 0, texture 1 in TU 1, texture 2 in TU 2, and the light maps go in TU 3
|
// Init sampler objects. Texture 0 goes in texture unit 0, texture 1 in TU 1, texture 2 in TU 2, and the light maps go in TU 3
|
||||||
glUniform1i(OpenGL::uniformLocation(program, "u_tex0"), 0);
|
glUniform1i(OpenGL::uniformLocation(program, "u_tex0"), 0);
|
||||||
|
@ -477,7 +478,6 @@ void RendererGL::drawVertices(PICA::PrimType primType, std::span<const Vertex> v
|
||||||
programEntry.ready = true;
|
programEntry.ready = true;
|
||||||
|
|
||||||
programEntry.program.createFromBinary(compiledProgram->binary, compiledProgram->binaryFormat);
|
programEntry.program.createFromBinary(compiledProgram->binary, compiledProgram->binaryFormat);
|
||||||
programEntry.program.use();
|
|
||||||
initializeProgramEntry(gl, programEntry);
|
initializeProgramEntry(gl, programEntry);
|
||||||
|
|
||||||
delete compiledProgram;
|
delete compiledProgram;
|
||||||
|
@ -492,6 +492,7 @@ void RendererGL::drawVertices(PICA::PrimType primType, std::span<const Vertex> v
|
||||||
} else if (!shaderCache[fsConfig].ready) {
|
} else if (!shaderCache[fsConfig].ready) {
|
||||||
usingUbershader = true;
|
usingUbershader = true;
|
||||||
}
|
}
|
||||||
|
usingUbershader = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usingUbershader) {
|
if (usingUbershader) {
|
||||||
|
@ -917,8 +918,6 @@ OpenGL::Program& RendererGL::getSpecializedShader(const PICA::FragmentConfig& fs
|
||||||
|
|
||||||
OpenGL::Shader fragShader({fs.c_str(), fs.size()}, OpenGL::Fragment);
|
OpenGL::Shader fragShader({fs.c_str(), fs.size()}, OpenGL::Fragment);
|
||||||
program.create({defaultShadergenVs, fragShader});
|
program.create({defaultShadergenVs, fragShader});
|
||||||
gl.useProgram(program);
|
|
||||||
|
|
||||||
fragShader.free();
|
fragShader.free();
|
||||||
|
|
||||||
initializeProgramEntry(gl, programEntry);
|
initializeProgramEntry(gl, programEntry);
|
||||||
|
|
Loading…
Add table
Reference in a new issue