More whoopsies???!?

This commit is contained in:
offtkp 2024-07-31 04:06:26 +03:00
parent 5e0fceef63
commit f49a101170
4 changed files with 5 additions and 7 deletions

View file

@ -14,7 +14,7 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION
endif()
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_BUILD_TYPE Release)
endif()
project(Alber)

View file

@ -25,7 +25,7 @@ class GPU;
// Cached recompiled fragment shader
struct CachedProgram {
OpenGL::Program program;
OpenGL::Program program {};
GLuint uboBinding = 0;
bool ready = false;
};

View file

@ -82,8 +82,7 @@ void AsyncCompilerState::Start() {
}
}
// Sleep for a bit to avoid excessive CPU usage
std::this_thread::sleep_for(std::chrono::milliseconds(1));
std::this_thread::yield();
}
Frontend::AsyncCompiler::destroyContext(contextCreationUserdata, context);

View file

@ -27,6 +27,7 @@ namespace {
void initializeProgramEntry(GLStateManager& gl, CachedProgram& programEntry) {
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
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.program.createFromBinary(compiledProgram->binary, compiledProgram->binaryFormat);
programEntry.program.use();
initializeProgramEntry(gl, programEntry);
delete compiledProgram;
@ -492,6 +492,7 @@ void RendererGL::drawVertices(PICA::PrimType primType, std::span<const Vertex> v
} else if (!shaderCache[fsConfig].ready) {
usingUbershader = true;
}
usingUbershader = true;
}
if (usingUbershader) {
@ -917,8 +918,6 @@ OpenGL::Program& RendererGL::getSpecializedShader(const PICA::FragmentConfig& fs
OpenGL::Shader fragShader({fs.c_str(), fs.size()}, OpenGL::Fragment);
program.create({defaultShadergenVs, fragShader});
gl.useProgram(program);
fragShader.free();
initializeProgramEntry(gl, programEntry);