diff options
author | bunnei <bunneidev@gmail.com> | 2018-04-08 05:45:09 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2018-04-14 05:48:28 +0200 |
commit | 51f37f5061eec2d9a0a872aebd6b50e21bee19a6 (patch) | |
tree | 9419d0758e5df2e94af38e95443dd1563a7ee969 /src/video_core/renderer_opengl/gl_shader_manager.h | |
parent | maxwell_3d: Make memory_manager public. (diff) | |
download | yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.tar yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.tar.gz yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.tar.bz2 yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.tar.lz yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.tar.xz yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.tar.zst yuzu-51f37f5061eec2d9a0a872aebd6b50e21bee19a6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/video_core/renderer_opengl/gl_shader_manager.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_manager.h b/src/video_core/renderer_opengl/gl_shader_manager.h index 10e8b8b3a..b5a7b2a18 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.h +++ b/src/video_core/renderer_opengl/gl_shader_manager.h @@ -14,40 +14,27 @@ namespace GLShader { +using Tegra::Engines::Maxwell3D; + namespace Impl { void SetShaderUniformBlockBindings(GLuint shader); void SetShaderSamplerBindings(GLuint shader); } // namespace Impl -enum class UniformBindings : GLuint { Common, VS, GS, FS }; - /// 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 MaxwellUniformData { - void SetFromRegs(); + void SetFromRegs(const Maxwell3D::State::ShaderStageInfo& shader_stage); using ConstBuffer = std::array<GLvec4, 4>; - using Regs = Tegra::Engines::Maxwell3D::Regs; - - alignas(16) std::array<ConstBuffer, Regs::MaxConstBuffers> const_buffers; + alignas(16) std::array<ConstBuffer, Maxwell3D::Regs::MaxConstBuffers> const_buffers; }; +static_assert(sizeof(MaxwellUniformData) == 1024, "MaxwellUniformData structure size is incorrect"); static_assert(sizeof(MaxwellUniformData) < 16384, "MaxwellUniformData structure must be less than 16kb as per the OpenGL spec"); -struct VSUniformData { - MaxwellUniformData uniforms; -}; -static_assert(sizeof(VSUniformData) < 16384, - "VSUniformData structure must be less than 16kb as per the OpenGL spec"); - -struct FSUniformData { - MaxwellUniformData uniforms; -}; -static_assert(sizeof(FSUniformData) < 16384, - "VSUniformData structure must be less than 16kb as per the OpenGL spec"); - class OGLShaderStage { public: OGLShaderStage() = default; @@ -113,14 +100,14 @@ public: current.vs = vertex_shaders.Get(config, setup); } - void UseTrivialGeometryShader() { - current.gs = 0; - } - void UseProgrammableFragmentShader(const MaxwellFSConfig& config, const ShaderSetup setup) { current.fs = fragment_shaders.Get(config, setup); } + void UseTrivialGeometryShader() { + current.gs = 0; + } + void ApplyTo(OpenGLState& state) { // Workaround for AMD bug glUseProgramStages(pipeline.handle, |