diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/shader/shader_ir.h | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/video_core/shader/shader_ir.h b/src/video_core/shader/shader_ir.h index 5f3aef7ce..b93cde71a 100644 --- a/src/video_core/shader/shader_ir.h +++ b/src/video_core/shader/shader_ir.h | |||
| @@ -336,32 +336,23 @@ using Meta = std::variant<MetaArithmetic, MetaTexture, Tegra::Shader::HalfType>; | |||
| 336 | /// Holds any kind of operation that can be done in the IR | 336 | /// Holds any kind of operation that can be done in the IR |
| 337 | class OperationNode final { | 337 | class OperationNode final { |
| 338 | public: | 338 | public: |
| 339 | template <typename... T> | 339 | explicit OperationNode(OperationCode code) : code{code} {} |
| 340 | explicit constexpr OperationNode(OperationCode code) : code{code}, meta{} {} | ||
| 341 | 340 | ||
| 342 | template <typename... T> | 341 | explicit OperationNode(OperationCode code, Meta&& meta) : code{code}, meta{std::move(meta)} {} |
| 343 | explicit constexpr OperationNode(OperationCode code, Meta&& meta) | ||
| 344 | : code{code}, meta{std::move(meta)} {} | ||
| 345 | 342 | ||
| 346 | template <typename... T> | 343 | template <typename... T> |
| 347 | explicit constexpr OperationNode(OperationCode code, const T*... operands) | 344 | explicit OperationNode(OperationCode code, const T*... operands) |
| 348 | : OperationNode(code, {}, operands...) {} | 345 | : OperationNode(code, {}, operands...) {} |
| 349 | 346 | ||
| 350 | template <typename... T> | 347 | template <typename... T> |
| 351 | explicit constexpr OperationNode(OperationCode code, Meta&& meta, const T*... operands_) | 348 | explicit OperationNode(OperationCode code, Meta&& meta, const T*... operands_) |
| 352 | : code{code}, meta{std::move(meta)} { | 349 | : code{code}, meta{std::move(meta)}, operands{operands_...} {} |
| 353 | |||
| 354 | auto operands_list = {operands_...}; | ||
| 355 | for (auto& operand : operands_list) { | ||
| 356 | operands.push_back(operand); | ||
| 357 | } | ||
| 358 | } | ||
| 359 | 350 | ||
| 360 | explicit OperationNode(OperationCode code, Meta&& meta, std::vector<Node>&& operands) | 351 | explicit OperationNode(OperationCode code, Meta&& meta, std::vector<Node>&& operands) |
| 361 | : code{code}, meta{meta}, operands{std::move(operands)} {} | 352 | : code{code}, meta{meta}, operands{std::move(operands)} {} |
| 362 | 353 | ||
| 363 | explicit OperationNode(OperationCode code, std::vector<Node>&& operands) | 354 | explicit OperationNode(OperationCode code, std::vector<Node>&& operands) |
| 364 | : code{code}, meta{}, operands{std::move(operands)} {} | 355 | : code{code}, operands{std::move(operands)} {} |
| 365 | 356 | ||
| 366 | OperationCode GetCode() const { | 357 | OperationCode GetCode() const { |
| 367 | return code; | 358 | return code; |