Skip to content

Commit

Permalink
[spirv] Declare defaulted copy and move constructor for SpirvCodeBuffer.
Browse files Browse the repository at this point in the history
If a type has a destructor it will not get an implicit move constructor.

But if we declare a defaulted move constructor then we will get the copy
constructor deleted. So declare both to be defaulted.

Cuts 8.8% off shader translation time during loading in Overwatch 2.
  • Loading branch information
ishitatsuyuki authored and doitsujin committed Apr 6, 2023
1 parent 3ce3209 commit 6d14fff
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/spirv/spirv_code_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ namespace dxvk {

SpirvCodeBuffer();
explicit SpirvCodeBuffer(uint32_t size);
SpirvCodeBuffer(const SpirvCodeBuffer &) = default;
SpirvCodeBuffer(SpirvCodeBuffer &&) = default;
SpirvCodeBuffer(uint32_t size, const uint32_t* data);
SpirvCodeBuffer(std::istream& stream);

Expand All @@ -29,6 +31,9 @@ namespace dxvk {
: SpirvCodeBuffer(N, data) { }

~SpirvCodeBuffer();

SpirvCodeBuffer &operator=(const SpirvCodeBuffer &) = default;
SpirvCodeBuffer &operator=(SpirvCodeBuffer &&) = default;

/**
* \brief Code data
Expand Down

0 comments on commit 6d14fff

Please sign in to comment.