diff options
| author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-02-26 16:13:47 -0300 |
|---|---|---|
| committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-03-09 18:40:06 -0300 |
| commit | bd8b9bbcee93549f323352f227ff44d0e79e0ad4 (patch) | |
| tree | 5c68e7ab171db3f3d31bf27cd573c54a918f0708 /src/video_core/shader/const_buffer_locker.h | |
| parent | 22e825a3bc0d9bfb5f8c29a50724c2887014dc02 (diff) | |
gl_shader_cache: Rework shader cache and remove post-specializations
Instead of pre-specializing shaders and then post-specializing them,
drop the later and only "specialize" the shader while decoding it.
Diffstat (limited to 'src/video_core/shader/const_buffer_locker.h')
| -rw-r--r-- | src/video_core/shader/const_buffer_locker.h | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/video_core/shader/const_buffer_locker.h b/src/video_core/shader/const_buffer_locker.h index d3ea11087..7c6f7bbdd 100644 --- a/src/video_core/shader/const_buffer_locker.h +++ b/src/video_core/shader/const_buffer_locker.h @@ -26,7 +26,8 @@ using BindlessSamplerMap = */ class ConstBufferLocker { public: - explicit ConstBufferLocker(Tegra::Engines::ShaderType shader_stage); + explicit ConstBufferLocker(Tegra::Engines::ShaderType shader_stage, + VideoCore::GuestDriverProfile stored_guest_driver_profile); explicit ConstBufferLocker(Tegra::Engines::ShaderType shader_stage, Tegra::Engines::ConstBufferEngineInterface& engine); @@ -83,15 +84,13 @@ public: } /// Obtains access to the guest driver's profile. - VideoCore::GuestDriverProfile* AccessGuestDriverProfile() const { - if (engine) { - return &engine->AccessGuestDriverProfile(); - } - return nullptr; + VideoCore::GuestDriverProfile& AccessGuestDriverProfile() { + return engine ? engine->AccessGuestDriverProfile() : stored_guest_driver_profile; } private: const Tegra::Engines::ShaderType stage; + VideoCore::GuestDriverProfile stored_guest_driver_profile; Tegra::Engines::ConstBufferEngineInterface* engine = nullptr; KeyMap keys; BoundSamplerMap bound_samplers; |
