summaryrefslogtreecommitdiffstats
path: root/src/video_core/shader/shader_ir.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2020-04-16 07:07:42 +0200
committerReinUsesLisp <reinuseslisp@airmail.cc>2020-04-23 23:04:13 +0200
commit4fb921ff6bd6f9596c7e7cd9524932f2a44e9490 (patch)
treee48867fbae160e4f0ebf155f7dc4cf81c5683150 /src/video_core/shader/shader_ir.h
parentshader_ir: Turn classes into data structures (diff)
downloadyuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.tar
yuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.tar.gz
yuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.tar.bz2
yuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.tar.lz
yuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.tar.xz
yuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.tar.zst
yuzu-4fb921ff6bd6f9596c7e7cd9524932f2a44e9490.zip
Diffstat (limited to 'src/video_core/shader/shader_ir.h')
-rw-r--r--src/video_core/shader/shader_ir.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h
index ae5e414cb..748d73087 100644
--- a/src/video_core/shader/shader_ir.h
+++ b/src/video_core/shader/shader_ir.h
@@ -191,10 +191,14 @@ private:
friend class ASTDecoder;
struct SamplerInfo {
- Tegra::Shader::TextureType type;
- bool is_array;
- bool is_shadow;
- bool is_buffer;
+ std::optional<Tegra::Shader::TextureType> type;
+ std::optional<bool> is_array;
+ std::optional<bool> is_shadow;
+ std::optional<bool> is_buffer;
+
+ constexpr bool IsComplete() const noexcept {
+ return type && is_array && is_shadow && is_buffer;
+ }
};
void Decode();
@@ -327,17 +331,15 @@ private:
OperationCode GetPredicateCombiner(Tegra::Shader::PredOperation operation);
/// Queries the missing sampler info from the execution context.
- SamplerInfo GetSamplerInfo(std::optional<SamplerInfo> sampler_info, u32 offset,
+ SamplerInfo GetSamplerInfo(SamplerInfo info, u32 offset,
std::optional<u32> buffer = std::nullopt);
- /// Accesses a texture sampler
- std::optional<Sampler> GetSampler(const Tegra::Shader::Sampler& sampler,
- std::optional<SamplerInfo> sampler_info = std::nullopt);
+ /// Accesses a texture sampler.
+ std::optional<Sampler> GetSampler(Tegra::Shader::Sampler sampler, SamplerInfo info);
/// Accesses a texture sampler for a bindless texture.
- std::optional<Sampler> GetBindlessSampler(
- Tegra::Shader::Register reg, Node& index_var,
- std::optional<SamplerInfo> sampler_info = std::nullopt);
+ std::optional<Sampler> GetBindlessSampler(Tegra::Shader::Register reg, SamplerInfo info,
+ Node& index_var);
/// Accesses an image.
Image& GetImage(Tegra::Shader::Image image, Tegra::Shader::ImageType type);