From 5b989f189fbf30535f5509a2157dc755fcb4d8f0 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Thu, 26 Dec 2019 16:38:39 -0300 Subject: gl_rasterizer: Allow rendering without fragment shader Rendering without a fragment shader is usually used in depth-only passes. --- src/video_core/renderer_opengl/gl_rasterizer.cpp | 3 +++ src/video_core/renderer_opengl/gl_shader_manager.h | 4 ++++ 2 files changed, 7 insertions(+) (limited to 'src/video_core') diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index dbb08dd80..672051102 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp @@ -271,6 +271,9 @@ void RasterizerOpenGL::SetupShaders(GLenum primitive_mode) { case Maxwell::ShaderProgram::Geometry: shader_program_manager->UseTrivialGeometryShader(); break; + case Maxwell::ShaderProgram::Fragment: + shader_program_manager->UseTrivialFragmentShader(); + break; default: break; } diff --git a/src/video_core/renderer_opengl/gl_shader_manager.h b/src/video_core/renderer_opengl/gl_shader_manager.h index 3703e7018..478c165ce 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.h +++ b/src/video_core/renderer_opengl/gl_shader_manager.h @@ -50,6 +50,10 @@ public: current_state.geometry_shader = 0; } + void UseTrivialFragmentShader() { + current_state.fragment_shader = 0; + } + private: struct PipelineState { bool operator==(const PipelineState& rhs) const { -- cgit v1.2.3