summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/video_core/shader/node.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/video_core/shader/node.h b/src/video_core/shader/node.h
index 8b081030f..a1e2c4d8e 100644
--- a/src/video_core/shader/node.h
+++ b/src/video_core/shader/node.h
@@ -379,7 +379,7 @@ struct GlobalMemoryBase {
379 u32 cbuf_index = 0; 379 u32 cbuf_index = 0;
380 u32 cbuf_offset = 0; 380 u32 cbuf_offset = 0;
381 381
382 bool operator<(const GlobalMemoryBase& rhs) const { 382 [[nodiscard]] bool operator<(const GlobalMemoryBase& rhs) const {
383 return std::tie(cbuf_index, cbuf_offset) < std::tie(rhs.cbuf_index, rhs.cbuf_offset); 383 return std::tie(cbuf_index, cbuf_offset) < std::tie(rhs.cbuf_index, rhs.cbuf_offset);
384 } 384 }
385}; 385};
@@ -416,7 +416,7 @@ using Meta =
416 416
417class AmendNode { 417class AmendNode {
418public: 418public:
419 std::optional<std::size_t> GetAmendIndex() const { 419 [[nodiscard]] std::optional<std::size_t> GetAmendIndex() const {
420 if (amend_index == amend_null_index) { 420 if (amend_index == amend_null_index) {
421 return std::nullopt; 421 return std::nullopt;
422 } 422 }
@@ -454,19 +454,19 @@ public:
454 explicit OperationNode(OperationCode code_, Meta meta_, Args&&... operands_) 454 explicit OperationNode(OperationCode code_, Meta meta_, Args&&... operands_)
455 : code{code_}, meta{std::move(meta_)}, operands{operands_...} {} 455 : code{code_}, meta{std::move(meta_)}, operands{operands_...} {}
456 456
457 OperationCode GetCode() const { 457 [[nodiscard]] OperationCode GetCode() const {
458 return code; 458 return code;
459 } 459 }
460 460
461 const Meta& GetMeta() const { 461 [[nodiscard]] const Meta& GetMeta() const {
462 return meta; 462 return meta;
463 } 463 }
464 464
465 std::size_t GetOperandsCount() const { 465 [[nodiscard]] std::size_t GetOperandsCount() const {
466 return operands.size(); 466 return operands.size();
467 } 467 }
468 468
469 const Node& operator[](std::size_t operand_index) const { 469 [[nodiscard]] const Node& operator[](std::size_t operand_index) const {
470 return operands.at(operand_index); 470 return operands.at(operand_index);
471 } 471 }
472 472
@@ -482,11 +482,11 @@ public:
482 explicit ConditionalNode(Node condition_, std::vector<Node>&& code_) 482 explicit ConditionalNode(Node condition_, std::vector<Node>&& code_)
483 : condition{std::move(condition_)}, code{std::move(code_)} {} 483 : condition{std::move(condition_)}, code{std::move(code_)} {}
484 484
485 const Node& GetCondition() const { 485 [[nodiscard]] const Node& GetCondition() const {
486 return condition; 486 return condition;
487 } 487 }
488 488
489 const std::vector<Node>& GetCode() const { 489 [[nodiscard]] const std::vector<Node>& GetCode() const {
490 return code; 490 return code;
491 } 491 }
492 492
@@ -500,7 +500,7 @@ class GprNode final {
500public: 500public:
501 explicit constexpr GprNode(Tegra::Shader::Register index_) : index{index_} {} 501 explicit constexpr GprNode(Tegra::Shader::Register index_) : index{index_} {}
502 502
503 u32 GetIndex() const { 503 [[nodiscard]] constexpr u32 GetIndex() const {
504 return static_cast<u32>(index); 504 return static_cast<u32>(index);
505 } 505 }
506 506
@@ -513,7 +513,7 @@ class CustomVarNode final {
513public: 513public:
514 explicit constexpr CustomVarNode(u32 index_) : index{index_} {} 514 explicit constexpr CustomVarNode(u32 index_) : index{index_} {}
515 515
516 constexpr u32 GetIndex() const { 516 [[nodiscard]] constexpr u32 GetIndex() const {
517 return index; 517 return index;
518 } 518 }
519 519
@@ -526,7 +526,7 @@ class ImmediateNode final {
526public: 526public:
527 explicit constexpr ImmediateNode(u32 value_) : value{value_} {} 527 explicit constexpr ImmediateNode(u32 value_) : value{value_} {}
528 528
529 u32 GetValue() const { 529 [[nodiscard]] constexpr u32 GetValue() const {
530 return value; 530 return value;
531 } 531 }
532 532
@@ -539,7 +539,7 @@ class InternalFlagNode final {
539public: 539public:
540 explicit constexpr InternalFlagNode(InternalFlag flag_) : flag{flag_} {} 540 explicit constexpr InternalFlagNode(InternalFlag flag_) : flag{flag_} {}
541 541
542 InternalFlag GetFlag() const { 542 [[nodiscard]] constexpr InternalFlag GetFlag() const {
543 return flag; 543 return flag;
544 } 544 }
545 545
@@ -553,11 +553,11 @@ public:
553 explicit constexpr PredicateNode(Tegra::Shader::Pred index_, bool negated_) 553 explicit constexpr PredicateNode(Tegra::Shader::Pred index_, bool negated_)
554 : index{index_}, negated{negated_} {} 554 : index{index_}, negated{negated_} {}
555 555
556 Tegra::Shader::Pred GetIndex() const { 556 [[nodiscard]] constexpr Tegra::Shader::Pred GetIndex() const {
557 return index; 557 return index;
558 } 558 }
559 559
560 bool IsNegated() const { 560 [[nodiscard]] constexpr bool IsNegated() const {
561 return negated; 561 return negated;
562 } 562 }
563 563
@@ -577,23 +577,23 @@ public:
577 explicit AbufNode(Node physical_address_, Node buffer_ = {}) 577 explicit AbufNode(Node physical_address_, Node buffer_ = {})
578 : physical_address{std::move(physical_address_)}, buffer{std::move(buffer_)} {} 578 : physical_address{std::move(physical_address_)}, buffer{std::move(buffer_)} {}
579 579
580 Tegra::Shader::Attribute::Index GetIndex() const { 580 [[nodiscard]] Tegra::Shader::Attribute::Index GetIndex() const {
581 return index; 581 return index;
582 } 582 }
583 583
584 u32 GetElement() const { 584 [[nodiscard]] u32 GetElement() const {
585 return element; 585 return element;
586 } 586 }
587 587
588 const Node& GetBuffer() const { 588 [[nodiscard]] const Node& GetBuffer() const {
589 return buffer; 589 return buffer;
590 } 590 }
591 591
592 bool IsPhysicalBuffer() const { 592 [[nodiscard]] bool IsPhysicalBuffer() const {
593 return static_cast<bool>(physical_address); 593 return static_cast<bool>(physical_address);
594 } 594 }
595 595
596 const Node& GetPhysicalAddress() const { 596 [[nodiscard]] const Node& GetPhysicalAddress() const {
597 return physical_address; 597 return physical_address;
598 } 598 }
599 599
@@ -607,9 +607,9 @@ private:
607/// Patch memory (used to communicate tessellation stages). 607/// Patch memory (used to communicate tessellation stages).
608class PatchNode final { 608class PatchNode final {
609public: 609public:
610 explicit PatchNode(u32 offset_) : offset{offset_} {} 610 explicit constexpr PatchNode(u32 offset_) : offset{offset_} {}
611 611
612 u32 GetOffset() const { 612 [[nodiscard]] constexpr u32 GetOffset() const {
613 return offset; 613 return offset;
614 } 614 }
615 615
@@ -622,11 +622,11 @@ class CbufNode final {
622public: 622public:
623 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_)} {}
624 624
625 u32 GetIndex() const { 625 [[nodiscard]] u32 GetIndex() const {
626 return index; 626 return index;
627 } 627 }
628 628
629 const Node& GetOffset() const { 629 [[nodiscard]] const Node& GetOffset() const {
630 return offset; 630 return offset;
631 } 631 }
632 632
@@ -640,7 +640,7 @@ class LmemNode final {
640public: 640public:
641 explicit LmemNode(Node address_) : address{std::move(address_)} {} 641 explicit LmemNode(Node address_) : address{std::move(address_)} {}
642 642
643 const Node& GetAddress() const { 643 [[nodiscard]] const Node& GetAddress() const {
644 return address; 644 return address;
645 } 645 }
646 646
@@ -653,7 +653,7 @@ class SmemNode final {
653public: 653public:
654 explicit SmemNode(Node address_) : address{std::move(address_)} {} 654 explicit SmemNode(Node address_) : address{std::move(address_)} {}
655 655
656 const Node& GetAddress() const { 656 [[nodiscard]] const Node& GetAddress() const {
657 return address; 657 return address;
658 } 658 }
659 659
@@ -668,15 +668,15 @@ public:
668 : 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_)},
669 descriptor{descriptor_} {} 669 descriptor{descriptor_} {}
670 670
671 const Node& GetRealAddress() const { 671 [[nodiscard]] const Node& GetRealAddress() const {
672 return real_address; 672 return real_address;
673 } 673 }
674 674
675 const Node& GetBaseAddress() const { 675 [[nodiscard]] const Node& GetBaseAddress() const {
676 return base_address; 676 return base_address;
677 } 677 }
678 678
679 const GlobalMemoryBase& GetDescriptor() const { 679 [[nodiscard]] const GlobalMemoryBase& GetDescriptor() const {
680 return descriptor; 680 return descriptor;
681 } 681 }
682 682
@@ -691,7 +691,7 @@ class CommentNode final {
691public: 691public:
692 explicit CommentNode(std::string text_) : text{std::move(text_)} {} 692 explicit CommentNode(std::string text_) : text{std::move(text_)} {}
693 693
694 const std::string& GetText() const { 694 [[nodiscard]] const std::string& GetText() const {
695 return text; 695 return text;
696 } 696 }
697 697