diff options
| author | 2019-11-06 04:32:43 -0300 | |
|---|---|---|
| committer | 2019-11-22 21:28:47 -0300 | |
| commit | 32c1bc6a67820f9df21c8f64f4df078b015aa7da (patch) | |
| tree | 141df885726a01fbd7d999d6ee314b4d11c8ce56 /src/video_core/shader/node.h | |
| parent | Merge pull request #3142 from ReinUsesLisp/depbar-log (diff) | |
| download | yuzu-32c1bc6a67820f9df21c8f64f4df078b015aa7da.tar.gz yuzu-32c1bc6a67820f9df21c8f64f4df078b015aa7da.tar.xz yuzu-32c1bc6a67820f9df21c8f64f4df078b015aa7da.zip | |
shader/texture: Deduce texture buffers from locker
Instead of specializing shaders to separate texture buffers from 1D
textures, use the locker to deduce them while they are being decoded.
Diffstat (limited to 'src/video_core/shader/node.h')
| -rw-r--r-- | src/video_core/shader/node.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h index 54217e6a4..44d85d434 100644 --- a/src/video_core/shader/node.h +++ b/src/video_core/shader/node.h | |||
| @@ -225,14 +225,15 @@ class Sampler { | |||
| 225 | public: | 225 | public: |
| 226 | /// This constructor is for bound samplers | 226 | /// This constructor is for bound samplers |
| 227 | constexpr explicit Sampler(u32 index, u32 offset, Tegra::Shader::TextureType type, | 227 | constexpr explicit Sampler(u32 index, u32 offset, Tegra::Shader::TextureType type, |
| 228 | bool is_array, bool is_shadow) | 228 | bool is_array, bool is_shadow, bool is_buffer) |
| 229 | : index{index}, offset{offset}, type{type}, is_array{is_array}, is_shadow{is_shadow} {} | 229 | : index{index}, offset{offset}, type{type}, is_array{is_array}, is_shadow{is_shadow}, |
| 230 | is_buffer{is_buffer} {} | ||
| 230 | 231 | ||
| 231 | /// This constructor is for bindless samplers | 232 | /// This constructor is for bindless samplers |
| 232 | constexpr explicit Sampler(u32 index, u32 offset, u32 buffer, Tegra::Shader::TextureType type, | 233 | constexpr explicit Sampler(u32 index, u32 offset, u32 buffer, Tegra::Shader::TextureType type, |
| 233 | bool is_array, bool is_shadow) | 234 | bool is_array, bool is_shadow, bool is_buffer) |
| 234 | : index{index}, offset{offset}, buffer{buffer}, type{type}, is_array{is_array}, | 235 | : index{index}, offset{offset}, buffer{buffer}, type{type}, is_array{is_array}, |
| 235 | is_shadow{is_shadow}, is_bindless{true} {} | 236 | is_shadow{is_shadow}, is_buffer{is_buffer}, is_bindless{true} {} |
| 236 | 237 | ||
| 237 | constexpr u32 GetIndex() const { | 238 | constexpr u32 GetIndex() const { |
| 238 | return index; | 239 | return index; |
| @@ -258,6 +259,10 @@ public: | |||
| 258 | return is_shadow; | 259 | return is_shadow; |
| 259 | } | 260 | } |
| 260 | 261 | ||
| 262 | constexpr bool IsBuffer() const { | ||
| 263 | return is_buffer; | ||
| 264 | } | ||
| 265 | |||
| 261 | constexpr bool IsBindless() const { | 266 | constexpr bool IsBindless() const { |
| 262 | return is_bindless; | 267 | return is_bindless; |
| 263 | } | 268 | } |
| @@ -270,6 +275,7 @@ private: | |||
| 270 | Tegra::Shader::TextureType type{}; ///< The type used to sample this texture (Texture2D, etc) | 275 | Tegra::Shader::TextureType type{}; ///< The type used to sample this texture (Texture2D, etc) |
| 271 | bool is_array{}; ///< Whether the texture is being sampled as an array texture or not. | 276 | bool is_array{}; ///< Whether the texture is being sampled as an array texture or not. |
| 272 | bool is_shadow{}; ///< Whether the texture is being sampled as a depth texture or not. | 277 | bool is_shadow{}; ///< Whether the texture is being sampled as a depth texture or not. |
| 278 | bool is_buffer{}; ///< Whether the texture is a texture buffer without sampler. | ||
| 273 | bool is_bindless{}; ///< Whether this sampler belongs to a bindless texture or not. | 279 | bool is_bindless{}; ///< Whether this sampler belongs to a bindless texture or not. |
| 274 | }; | 280 | }; |
| 275 | 281 | ||