diff options
author | bunnei <bunneidev@gmail.com> | 2019-07-22 17:12:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-22 17:12:55 +0200 |
commit | f601f25bcc76f54ac0fa983cd74141bb075468de (patch) | |
tree | f126d994a186281792f331928d5139f68f0bfec8 /src/video_core/renderer_opengl/gl_shader_util.cpp | |
parent | Merge pull request #2735 from FernandoS27/pipeline-rework (diff) | |
parent | gl_shader_cache: Fix clang-format issues (diff) | |
download | yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.tar yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.tar.gz yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.tar.bz2 yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.tar.lz yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.tar.xz yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.tar.zst yuzu-f601f25bcc76f54ac0fa983cd74141bb075468de.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_util.cpp')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_util.cpp | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_util.cpp b/src/video_core/renderer_opengl/gl_shader_util.cpp index 5f3fe067e..9e74eda0d 100644 --- a/src/video_core/renderer_opengl/gl_shader_util.cpp +++ b/src/video_core/renderer_opengl/gl_shader_util.cpp @@ -10,21 +10,25 @@ namespace OpenGL::GLShader { -GLuint LoadShader(const char* source, GLenum type) { - const char* debug_type; +namespace { +const char* GetStageDebugName(GLenum type) { switch (type) { case GL_VERTEX_SHADER: - debug_type = "vertex"; - break; + return "vertex"; case GL_GEOMETRY_SHADER: - debug_type = "geometry"; - break; + return "geometry"; case GL_FRAGMENT_SHADER: - debug_type = "fragment"; - break; - default: - UNREACHABLE(); + return "fragment"; + case GL_COMPUTE_SHADER: + return "compute"; } + UNIMPLEMENTED(); + return "unknown"; +} +} // Anonymous namespace + +GLuint LoadShader(const char* source, GLenum type) { + const char* debug_type = GetStageDebugName(type); const GLuint shader_id = glCreateShader(type); glShaderSource(shader_id, 1, &source, nullptr); LOG_DEBUG(Render_OpenGL, "Compiling {} shader...", debug_type); |