diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-19 01:38:15 +0100 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2019-11-23 01:28:49 +0100 |
commit | 180417c51438e2c97b800f4b19e621dbc8288493 (patch) | |
tree | f9b6d755d10c80a0bef5cda6a2254a0a497f93a2 /src/video_core/renderer_opengl/gl_device.h | |
parent | video_core: Unify ProgramType and ShaderStage into ShaderType (diff) | |
download | yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.gz yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.bz2 yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.lz yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.xz yuzu-180417c51438e2c97b800f4b19e621dbc8288493.tar.zst yuzu-180417c51438e2c97b800f4b19e621dbc8288493.zip |
Diffstat (limited to 'src/video_core/renderer_opengl/gl_device.h')
-rw-r--r-- | src/video_core/renderer_opengl/gl_device.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/video_core/renderer_opengl/gl_device.h b/src/video_core/renderer_opengl/gl_device.h index 6c86fe207..e7d3c48b0 100644 --- a/src/video_core/renderer_opengl/gl_device.h +++ b/src/video_core/renderer_opengl/gl_device.h @@ -6,14 +6,32 @@ #include <cstddef> #include "common/common_types.h" +#include "video_core/engines/shader_type.h" namespace OpenGL { -class Device { +static constexpr u32 EmulationUniformBlockBinding = 0; + +class Device final { public: + struct BaseBindings final { + u32 uniform_buffer{}; + u32 shader_storage_buffer{}; + u32 sampler{}; + u32 image{}; + }; + explicit Device(); explicit Device(std::nullptr_t); + const BaseBindings& GetBaseBindings(std::size_t stage_index) const noexcept { + return base_bindings[stage_index]; + } + + const BaseBindings& GetBaseBindings(Tegra::Engines::ShaderType shader_type) const noexcept { + return GetBaseBindings(static_cast<std::size_t>(shader_type)); + } + std::size_t GetUniformBufferAlignment() const { return uniform_buffer_alignment; } @@ -67,6 +85,7 @@ private: static bool TestComponentIndexingBug(); static bool TestPreciseBug(); + std::array<BaseBindings, Tegra::Engines::MaxShaderTypes> base_bindings; std::size_t uniform_buffer_alignment{}; std::size_t shader_storage_alignment{}; u32 max_vertex_attributes{}; |