diff options
Diffstat (limited to 'src/video_core/shader/node.h')
| -rw-r--r-- | src/video_core/shader/node.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h index 8db9e1de7..b54d33763 100644 --- a/src/video_core/shader/node.h +++ b/src/video_core/shader/node.h | |||
| @@ -282,25 +282,24 @@ struct SeparateSamplerNode; | |||
| 282 | using TrackSamplerData = std::variant<BindlessSamplerNode, SeparateSamplerNode, ArraySamplerNode>; | 282 | using TrackSamplerData = std::variant<BindlessSamplerNode, SeparateSamplerNode, ArraySamplerNode>; |
| 283 | using TrackSampler = std::shared_ptr<TrackSamplerData>; | 283 | using TrackSampler = std::shared_ptr<TrackSamplerData>; |
| 284 | 284 | ||
| 285 | struct Sampler { | 285 | struct SamplerEntry { |
| 286 | /// Bound samplers constructor | 286 | /// Bound samplers constructor |
| 287 | constexpr explicit Sampler(u32 index_, u32 offset_, Tegra::Shader::TextureType type_, | 287 | explicit SamplerEntry(u32 index_, u32 offset_, Tegra::Shader::TextureType type_, bool is_array_, |
| 288 | bool is_array_, bool is_shadow_, bool is_buffer_, bool is_indexed_) | 288 | bool is_shadow_, bool is_buffer_, bool is_indexed_) |
| 289 | : index{index_}, offset{offset_}, type{type_}, is_array{is_array_}, is_shadow{is_shadow_}, | 289 | : index{index_}, offset{offset_}, type{type_}, is_array{is_array_}, is_shadow{is_shadow_}, |
| 290 | is_buffer{is_buffer_}, is_indexed{is_indexed_} {} | 290 | is_buffer{is_buffer_}, is_indexed{is_indexed_} {} |
| 291 | 291 | ||
| 292 | /// Separate sampler constructor | 292 | /// Separate sampler constructor |
| 293 | constexpr explicit Sampler(u32 index_, std::pair<u32, u32> offsets_, | 293 | explicit SamplerEntry(u32 index_, std::pair<u32, u32> offsets, std::pair<u32, u32> buffers, |
| 294 | std::pair<u32, u32> buffers_, Tegra::Shader::TextureType type_, | 294 | Tegra::Shader::TextureType type_, bool is_array_, bool is_shadow_, |
| 295 | bool is_array_, bool is_shadow_, bool is_buffer_) | 295 | bool is_buffer_) |
| 296 | : index{index_}, offset{offsets_.first}, secondary_offset{offsets_.second}, | 296 | : index{index_}, offset{offsets.first}, secondary_offset{offsets.second}, |
| 297 | buffer{buffers_.first}, secondary_buffer{buffers_.second}, type{type_}, | 297 | buffer{buffers.first}, secondary_buffer{buffers.second}, type{type_}, is_array{is_array_}, |
| 298 | is_array{is_array_}, is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_separated{true} {} | 298 | is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_separated{true} {} |
| 299 | 299 | ||
| 300 | /// Bindless samplers constructor | 300 | /// Bindless samplers constructor |
| 301 | constexpr explicit Sampler(u32 index_, u32 offset_, u32 buffer_, | 301 | explicit SamplerEntry(u32 index_, u32 offset_, u32 buffer_, Tegra::Shader::TextureType type_, |
| 302 | Tegra::Shader::TextureType type_, bool is_array_, bool is_shadow_, | 302 | bool is_array_, bool is_shadow_, bool is_buffer_, bool is_indexed_) |
| 303 | bool is_buffer_, bool is_indexed_) | ||
| 304 | : index{index_}, offset{offset_}, buffer{buffer_}, type{type_}, is_array{is_array_}, | 303 | : index{index_}, offset{offset_}, buffer{buffer_}, type{type_}, is_array{is_array_}, |
| 305 | is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_bindless{true}, is_indexed{is_indexed_} { | 304 | is_shadow{is_shadow_}, is_buffer{is_buffer_}, is_bindless{true}, is_indexed{is_indexed_} { |
| 306 | } | 305 | } |
| @@ -340,14 +339,14 @@ struct BindlessSamplerNode { | |||
| 340 | u32 offset; | 339 | u32 offset; |
| 341 | }; | 340 | }; |
| 342 | 341 | ||
| 343 | struct Image { | 342 | struct ImageEntry { |
| 344 | public: | 343 | public: |
| 345 | /// Bound images constructor | 344 | /// Bound images constructor |
| 346 | constexpr explicit Image(u32 index_, u32 offset_, Tegra::Shader::ImageType type_) | 345 | explicit ImageEntry(u32 index_, u32 offset_, Tegra::Shader::ImageType type_) |
| 347 | : index{index_}, offset{offset_}, type{type_} {} | 346 | : index{index_}, offset{offset_}, type{type_} {} |
| 348 | 347 | ||
| 349 | /// Bindless samplers constructor | 348 | /// Bindless samplers constructor |
| 350 | constexpr explicit Image(u32 index_, u32 offset_, u32 buffer_, Tegra::Shader::ImageType type_) | 349 | explicit ImageEntry(u32 index_, u32 offset_, u32 buffer_, Tegra::Shader::ImageType type_) |
| 351 | : index{index_}, offset{offset_}, buffer{buffer_}, type{type_}, is_bindless{true} {} | 350 | : index{index_}, offset{offset_}, buffer{buffer_}, type{type_}, is_bindless{true} {} |
| 352 | 351 | ||
| 353 | void MarkWrite() { | 352 | void MarkWrite() { |
| @@ -391,7 +390,7 @@ struct MetaArithmetic { | |||
| 391 | 390 | ||
| 392 | /// Parameters describing a texture sampler | 391 | /// Parameters describing a texture sampler |
| 393 | struct MetaTexture { | 392 | struct MetaTexture { |
| 394 | Sampler sampler; | 393 | SamplerEntry sampler; |
| 395 | Node array; | 394 | Node array; |
| 396 | Node depth_compare; | 395 | Node depth_compare; |
| 397 | std::vector<Node> aoffi; | 396 | std::vector<Node> aoffi; |
| @@ -405,7 +404,7 @@ struct MetaTexture { | |||
| 405 | }; | 404 | }; |
| 406 | 405 | ||
| 407 | struct MetaImage { | 406 | struct MetaImage { |
| 408 | const Image& image; | 407 | const ImageEntry& image; |
| 409 | std::vector<Node> values; | 408 | std::vector<Node> values; |
| 410 | u32 element{}; | 409 | u32 element{}; |
| 411 | }; | 410 | }; |