yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

glsl: Rebase fixes

This commit is contained in:
ameerj 2021-06-07 19:05:11 -04:00
parent fc0db612ab
commit 970fc39d98
2 changed files with 5 additions and 3 deletions

View File

@ -225,7 +225,6 @@ ShaderCache::ShaderCache(RasterizerOpenGL& rasterizer_, Core::Frontend::EmuWindo
.support_derivative_control = device.HasDerivativeControl(),
.support_gl_nv_gpu_shader_5 = device.HasNvGpuShader5(),
.support_gl_amd_gpu_shader_half_float = device.HasAmdShaderHalfFloat(),
.support_gl_vertex_viewport_layer = device.HasVertexViewportLayer(),
.support_gl_texture_shadow_lod = device.HasTextureShadowLod(),
.warp_size_potentially_larger_than_guest = device.IsWarpSizePotentiallyLargerThanGuest(),

View File

@ -13,7 +13,7 @@
namespace OpenGL {
static void LogShader(GLuint shader) {
static void LogShader(GLuint shader, std::optional<std::string_view> code = {}) {
GLint shader_status{};
glGetShaderiv(shader, GL_COMPILE_STATUS, &shader_status);
if (shader_status == GL_FALSE) {
@ -28,6 +28,9 @@ static void LogShader(GLuint shader) {
glGetShaderInfoLog(shader, log_length, nullptr, log.data());
if (shader_status == GL_FALSE) {
LOG_ERROR(Render_OpenGL, "{}", log);
if (code.has_value()) {
LOG_INFO(Render_OpenGL, "\n{}", *code);
}
} else {
LOG_WARNING(Render_OpenGL, "{}", log);
}
@ -43,7 +46,7 @@ void AttachShader(GLenum stage, GLuint program, std::string_view code) {
glCompileShader(shader.handle);
glAttachShader(program, shader.handle);
if (Settings::values.renderer_debug) {
LogShader(shader.handle);
LogShader(shader.handle, code);
}
}