summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/shader/node.h96
1 files changed, 49 insertions, 47 deletions
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h
index 8f230d57a..8b081030f 100644
--- a/src/video_core/shader/node.h
+++ b/src/video_core/shader/node.h
@@ -284,24 +284,26 @@ using TrackSampler = std::shared_ptr<TrackSamplerData>;
284 284
285struct Sampler { 285struct Sampler {
286 /// Bound samplers constructor 286 /// Bound samplers constructor
287 constexpr explicit Sampler(u32 index, u32 offset, Tegra::Shader::TextureType type, 287 constexpr explicit Sampler(u32 index_, u32 offset_, Tegra::Shader::TextureType type_,
288 bool is_array, bool is_shadow, bool is_buffer, bool is_indexed) 288 bool is_array_, 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, std::pair<u32, u32> buffers, 293 constexpr explicit Sampler(u32 index_, std::pair<u32, u32> offsets, std::pair<u32, u32> buffers,
294 Tegra::Shader::TextureType type, bool is_array, bool is_shadow, 294 Tegra::Shader::TextureType type, bool is_array_, bool is_shadow_,
295 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}, is_array{is_array}, 297 buffer{buffers.first}, secondary_buffer{buffers.second}, type{type}, is_array{is_array_},
298 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, Tegra::Shader::TextureType type, 301 constexpr explicit Sampler(u32 index_, u32 offset_, u32 buffer_,
302 bool is_array, bool is_shadow, bool is_buffer, bool is_indexed) 302 Tegra::Shader::TextureType type, bool is_array_, bool is_shadow_,
303 : index{index}, offset{offset}, buffer{buffer}, type{type}, is_array{is_array}, 303 bool is_buffer_, bool is_indexed_)
304 is_shadow{is_shadow}, is_buffer{is_buffer}, is_bindless{true}, is_indexed{is_indexed} {} 304 : 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_} {
306 }
305 307
306 u32 index = 0; ///< Emulated index given for the this sampler. 308 u32 index = 0; ///< Emulated index given for the this sampler.
307 u32 offset = 0; ///< Offset in the const buffer from where the sampler is being read. 309 u32 offset = 0; ///< Offset in the const buffer from where the sampler is being read.
@@ -341,12 +343,12 @@ struct BindlessSamplerNode {
341struct Image { 343struct Image {
342public: 344public:
343 /// Bound images constructor 345 /// Bound images constructor
344 constexpr explicit Image(u32 index, u32 offset, Tegra::Shader::ImageType type) 346 constexpr explicit Image(u32 index_, u32 offset_, Tegra::Shader::ImageType type_)
345 : index{index}, offset{offset}, type{type} {} 347 : index{index_}, offset{offset_}, type{type_} {}
346 348
347 /// Bindless samplers constructor 349 /// Bindless samplers constructor
348 constexpr explicit Image(u32 index, u32 offset, u32 buffer, Tegra::Shader::ImageType type) 350 constexpr explicit Image(u32 index_, u32 offset_, u32 buffer_, Tegra::Shader::ImageType type_)
349 : index{index}, offset{offset}, buffer{buffer}, type{type}, is_bindless{true} {} 351 : index{index_}, offset{offset_}, buffer{buffer_}, type{type_}, is_bindless{true} {}
350 352
351 void MarkWrite() { 353 void MarkWrite() {
352 is_written = true; 354 is_written = true;
@@ -437,20 +439,20 @@ private:
437/// Holds any kind of operation that can be done in the IR 439/// Holds any kind of operation that can be done in the IR
438class OperationNode final : public AmendNode { 440class OperationNode final : public AmendNode {
439public: 441public:
440 explicit OperationNode(OperationCode code) : OperationNode(code, Meta{}) {} 442 explicit OperationNode(OperationCode code_) : OperationNode(code_, Meta{}) {}
441 443
442 explicit OperationNode(OperationCode code, Meta meta) 444 explicit OperationNode(OperationCode code_, Meta meta_)
443 : OperationNode(code, std::move(meta), std::vector<Node>{}) {} 445 : OperationNode(code_, std::move(meta_), std::vector<Node>{}) {}
444 446
445 explicit OperationNode(OperationCode code, std::vector<Node> operands) 447 explicit OperationNode(OperationCode code_, std::vector<Node> operands_)
446 : OperationNode(code, Meta{}, std::move(operands)) {} 448 : OperationNode(code_, Meta{}, std::move(operands_)) {}
447 449
448 explicit OperationNode(OperationCode code, Meta meta, std::vector<Node> operands) 450 explicit OperationNode(OperationCode code_, Meta meta_, std::vector<Node> operands_)
449 : code{code}, meta{std::move(meta)}, operands{std::move(operands)} {} 451 : code{code_}, meta{std::move(meta_)}, operands{std::move(operands_)} {}
450 452
451 template <typename... Args> 453 template <typename... Args>
452 explicit OperationNode(OperationCode code, Meta meta, Args&&... operands) 454 explicit OperationNode(OperationCode code_, Meta meta_, Args&&... operands_)
453 : code{code}, meta{std::move(meta)}, operands{operands...} {} 455 : code{code_}, meta{std::move(meta_)}, operands{operands_...} {}
454 456
455 OperationCode GetCode() const { 457 OperationCode GetCode() const {
456 return code; 458 return code;
@@ -477,8 +479,8 @@ private:
477/// Encloses inside any kind of node that returns a boolean conditionally-executed code 479/// Encloses inside any kind of node that returns a boolean conditionally-executed code
478class ConditionalNode final : public AmendNode { 480class ConditionalNode final : public AmendNode {
479public: 481public:
480 explicit ConditionalNode(Node condition, std::vector<Node>&& code) 482 explicit ConditionalNode(Node condition_, std::vector<Node>&& code_)
481 : condition{std::move(condition)}, code{std::move(code)} {} 483 : condition{std::move(condition_)}, code{std::move(code_)} {}
482 484
483 const Node& GetCondition() const { 485 const Node& GetCondition() const {
484 return condition; 486 return condition;
@@ -496,7 +498,7 @@ private:
496/// A general purpose register 498/// A general purpose register
497class GprNode final { 499class GprNode final {
498public: 500public:
499 explicit constexpr GprNode(Tegra::Shader::Register index) : index{index} {} 501 explicit constexpr GprNode(Tegra::Shader::Register index_) : index{index_} {}
500 502
501 u32 GetIndex() const { 503 u32 GetIndex() const {
502 return static_cast<u32>(index); 504 return static_cast<u32>(index);
@@ -509,7 +511,7 @@ private:
509/// A custom variable 511/// A custom variable
510class CustomVarNode final { 512class CustomVarNode final {
511public: 513public:
512 explicit constexpr CustomVarNode(u32 index) : index{index} {} 514 explicit constexpr CustomVarNode(u32 index_) : index{index_} {}
513 515
514 constexpr u32 GetIndex() const { 516 constexpr u32 GetIndex() const {
515 return index; 517 return index;
@@ -522,7 +524,7 @@ private:
522/// A 32-bits value that represents an immediate value 524/// A 32-bits value that represents an immediate value
523class ImmediateNode final { 525class ImmediateNode final {
524public: 526public:
525 explicit constexpr ImmediateNode(u32 value) : value{value} {} 527 explicit constexpr ImmediateNode(u32 value_) : value{value_} {}
526 528
527 u32 GetValue() const { 529 u32 GetValue() const {
528 return value; 530 return value;
@@ -535,7 +537,7 @@ private:
535/// One of Maxwell's internal flags 537/// One of Maxwell's internal flags
536class InternalFlagNode final { 538class InternalFlagNode final {
537public: 539public:
538 explicit constexpr InternalFlagNode(InternalFlag flag) : flag{flag} {} 540 explicit constexpr InternalFlagNode(InternalFlag flag_) : flag{flag_} {}
539 541
540 InternalFlag GetFlag() const { 542 InternalFlag GetFlag() const {
541 return flag; 543 return flag;
@@ -548,8 +550,8 @@ private:
548/// A predicate register, it can be negated without additional nodes 550/// A predicate register, it can be negated without additional nodes
549class PredicateNode final { 551class PredicateNode final {
550public: 552public:
551 explicit constexpr PredicateNode(Tegra::Shader::Pred index, bool negated) 553 explicit constexpr PredicateNode(Tegra::Shader::Pred index_, bool negated_)
552 : index{index}, negated{negated} {} 554 : index{index_}, negated{negated_} {}
553 555
554 Tegra::Shader::Pred GetIndex() const { 556 Tegra::Shader::Pred GetIndex() const {
555 return index; 557 return index;
@@ -568,12 +570,12 @@ private:
568class AbufNode final { 570class AbufNode final {
569public: 571public:
570 // Initialize for standard attributes (index is explicit). 572 // Initialize for standard attributes (index is explicit).
571 explicit AbufNode(Tegra::Shader::Attribute::Index index, u32 element, Node buffer = {}) 573 explicit AbufNode(Tegra::Shader::Attribute::Index index_, u32 element_, Node buffer_ = {})
572 : buffer{std::move(buffer)}, index{index}, element{element} {} 574 : buffer{std::move(buffer_)}, index{index_}, element{element_} {}
573 575
574 // Initialize for physical attributes (index is a variable value). 576 // Initialize for physical attributes (index is a variable value).
575 explicit AbufNode(Node physical_address, Node buffer = {}) 577 explicit AbufNode(Node physical_address_, Node buffer_ = {})
576 : physical_address{std::move(physical_address)}, buffer{std::move(buffer)} {} 578 : physical_address{std::move(physical_address_)}, buffer{std::move(buffer_)} {}
577 579
578 Tegra::Shader::Attribute::Index GetIndex() const { 580 Tegra::Shader::Attribute::Index GetIndex() const {
579 return index; 581 return index;
@@ -605,7 +607,7 @@ private:
605/// Patch memory (used to communicate tessellation stages). 607/// Patch memory (used to communicate tessellation stages).
606class PatchNode final { 608class PatchNode final {
607public: 609public:
608 explicit PatchNode(u32 offset) : offset{offset} {} 610 explicit PatchNode(u32 offset_) : offset{offset_} {}
609 611
610 u32 GetOffset() const { 612 u32 GetOffset() const {
611 return offset; 613 return offset;
@@ -618,7 +620,7 @@ private:
618/// Constant buffer node, usually mapped to uniform buffers in GLSL 620/// Constant buffer node, usually mapped to uniform buffers in GLSL
619class CbufNode final { 621class CbufNode final {
620public: 622public:
621 explicit CbufNode(u32 index, Node offset) : index{index}, offset{std::move(offset)} {} 623 explicit CbufNode(u32 index_, Node offset_) : index{index_}, offset{std::move(offset_)} {}
622 624
623 u32 GetIndex() const { 625 u32 GetIndex() const {
624 return index; 626 return index;
@@ -636,7 +638,7 @@ private:
636/// Local memory node 638/// Local memory node
637class LmemNode final { 639class LmemNode final {
638public: 640public:
639 explicit LmemNode(Node address) : address{std::move(address)} {} 641 explicit LmemNode(Node address_) : address{std::move(address_)} {}
640 642
641 const Node& GetAddress() const { 643 const Node& GetAddress() const {
642 return address; 644 return address;
@@ -649,7 +651,7 @@ private:
649/// Shared memory node 651/// Shared memory node
650class SmemNode final { 652class SmemNode final {
651public: 653public:
652 explicit SmemNode(Node address) : address{std::move(address)} {} 654 explicit SmemNode(Node address_) : address{std::move(address_)} {}
653 655
654 const Node& GetAddress() const { 656 const Node& GetAddress() const {
655 return address; 657 return address;
@@ -662,9 +664,9 @@ private:
662/// Global memory node 664/// Global memory node
663class GmemNode final { 665class GmemNode final {
664public: 666public:
665 explicit GmemNode(Node real_address, Node base_address, const GlobalMemoryBase& descriptor) 667 explicit GmemNode(Node real_address_, Node base_address_, const GlobalMemoryBase& descriptor_)
666 : real_address{std::move(real_address)}, base_address{std::move(base_address)}, 668 : real_address{std::move(real_address_)}, base_address{std::move(base_address_)},
667 descriptor{descriptor} {} 669 descriptor{descriptor_} {}
668 670
669 const Node& GetRealAddress() const { 671 const Node& GetRealAddress() const {
670 return real_address; 672 return real_address;
@@ -687,7 +689,7 @@ private:
687/// Commentary, can be dropped 689/// Commentary, can be dropped
688class CommentNode final { 690class CommentNode final {
689public: 691public:
690 explicit CommentNode(std::string text) : text{std::move(text)} {} 692 explicit CommentNode(std::string text_) : text{std::move(text_)} {}
691 693
692 const std::string& GetText() const { 694 const std::string& GetText() const {
693 return text; 695 return text;