summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_rasterizer.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-04-07 11:22:08 +0200
committerbunnei <bunneidev@gmail.com>2018-04-14 05:48:26 +0200
commit5617831d5fb42a692d09f2fd3c21cc1eac3ae903 (patch)
tree7b4988833857f6e80f83bf2193c325b19f0a2870 /src/video_core/renderer_opengl/gl_rasterizer.h
parentrenderer_opengl: Add gl_shader_manager class. (diff)
downloadyuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.tar
yuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.tar.gz
yuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.tar.bz2
yuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.tar.lz
yuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.tar.xz
yuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.tar.zst
yuzu-5617831d5fb42a692d09f2fd3c21cc1eac3ae903.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_rasterizer.h')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.h57
1 files changed, 4 insertions, 53 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.h b/src/video_core/renderer_opengl/gl_rasterizer.h
index 989c62d0d..b508f5acc 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.h
+++ b/src/video_core/renderer_opengl/gl_rasterizer.h
@@ -19,6 +19,7 @@
#include "video_core/renderer_opengl/gl_rasterizer_cache.h"
#include "video_core/renderer_opengl/gl_resource_manager.h"
#include "video_core/renderer_opengl/gl_shader_gen.h"
+#include "video_core/renderer_opengl/gl_shader_manager.h"
#include "video_core/renderer_opengl/gl_state.h"
#include "video_core/renderer_opengl/gl_stream_buffer.h"
@@ -56,34 +57,6 @@ public:
OGLShader shader;
};
- /// Uniform structure for the Uniform Buffer Object, all vectors must be 16-byte aligned
- // NOTE: Always keep a vec4 at the end. The GL spec is not clear wether the alignment at
- // the end of a uniform block is included in UNIFORM_BLOCK_DATA_SIZE or not.
- // Not following that rule will cause problems on some AMD drivers.
- struct UniformData {};
-
- // static_assert(
- // sizeof(UniformData) == 0x460,
- // "The size of the UniformData structure has changed, update the structure in the shader");
- static_assert(sizeof(UniformData) < 16384,
- "UniformData structure must be less than 16kb as per the OpenGL spec");
-
- struct VSUniformData {};
- // static_assert(
- // sizeof(VSUniformData) == 1856,
- // "The size of the VSUniformData structure has changed, update the structure in the
- // shader");
- static_assert(sizeof(VSUniformData) < 16384,
- "VSUniformData structure must be less than 16kb as per the OpenGL spec");
-
- struct FSUniformData {};
- // static_assert(
- // sizeof(FSUniformData) == 1856,
- // "The size of the FSUniformData structure has changed, update the structure in the
- // shader");
- static_assert(sizeof(FSUniformData) < 16384,
- "FSUniformData structure must be less than 16kb as per the OpenGL spec");
-
private:
class SamplerInfo {
public:
@@ -122,9 +95,6 @@ private:
/// Syncs the clip coefficients to match the guest state
void SyncClipCoef();
- /// Sets the OpenGL shader in accordance with the current guest state
- void SetShader();
-
/// Syncs the cull mode to match the guest state
void SyncCullMode();
@@ -152,18 +122,7 @@ private:
RasterizerCacheOpenGL res_cache;
- /// Shader used for test renderering - to be removed once we have emulated shaders
- MaxwellShader test_shader{};
-
- const MaxwellShader* current_shader{};
- bool shader_dirty{};
-
- struct {
- UniformData data;
- bool dirty;
- } uniform_block_data = {};
-
- OGLPipeline pipeline;
+ std::unique_ptr<GLShader::ProgramManager> shader_program_manager;
OGLVertexArray sw_vao;
OGLVertexArray hw_vao;
std::array<bool, 16> hw_vao_enabled_attributes;
@@ -183,18 +142,10 @@ private:
void SetupVertexArray(u8* array_ptr, GLintptr buffer_offset);
OGLBuffer vs_uniform_buffer;
- std::unordered_map<GLShader::MaxwellVSConfig, VertexShader*> vs_shader_map;
- std::unordered_map<std::string, VertexShader> vs_shader_cache;
- OGLShader vs_default_shader;
-
- void SetupVertexShader(VSUniformData* ub_ptr, GLintptr buffer_offset);
- OGLBuffer fs_uniform_buffer;
- std::unordered_map<GLShader::MaxwellFSConfig, FragmentShader*> fs_shader_map;
- std::unordered_map<std::string, FragmentShader> fs_shader_cache;
- OGLShader fs_default_shader;
+ void SetupVertexShader(GLShader::VSUniformData* ub_ptr, GLintptr buffer_offset);
- void SetupFragmentShader(FSUniformData* ub_ptr, GLintptr buffer_offset);
+ void SetupFragmentShader(GLShader::FSUniformData* ub_ptr, GLintptr buffer_offset);
enum class AccelDraw { Disabled, Arrays, Indexed };
AccelDraw accelerate_draw;