diff --git a/src/d3d11/d3d11_shader.cpp b/src/d3d11/d3d11_shader.cpp index bb0380104..2f2773ea3 100644 --- a/src/d3d11/d3d11_shader.cpp +++ b/src/d3d11/d3d11_shader.cpp @@ -40,8 +40,11 @@ namespace dxvk { m_shader->setDebugName(m_name); if (dumpPath.size() != 0) { - m_shader->dump(std::ofstream(str::format(dumpPath, "/", m_name, ".spv"), - std::ios_base::binary | std::ios_base::trunc)); + std::ofstream dumpStream( + str::format(dumpPath, "/", m_name, ".spv"), + std::ios_base::binary | std::ios_base::trunc); + + m_shader->dump(dumpStream); } // If requested by the user, replace @@ -53,7 +56,7 @@ namespace dxvk { std::ios_base::binary); if (readStream) - m_shader->read(std::move(readStream)); + m_shader->read(readStream); } } diff --git a/src/dxvk/dxvk_shader.cpp b/src/dxvk/dxvk_shader.cpp index 765597274..abedefd9b 100644 --- a/src/dxvk/dxvk_shader.cpp +++ b/src/dxvk/dxvk_shader.cpp @@ -86,13 +86,13 @@ namespace dxvk { } - void DxvkShader::dump(std::ostream&& outputStream) const { - m_code.store(std::move(outputStream)); + void DxvkShader::dump(std::ostream& outputStream) const { + m_code.store(outputStream); } - void DxvkShader::read(std::istream&& inputStream) { - m_code = SpirvCodeBuffer(std::move(inputStream)); + void DxvkShader::read(std::istream& inputStream) { + m_code = SpirvCodeBuffer(inputStream); } } \ No newline at end of file diff --git a/src/dxvk/dxvk_shader.h b/src/dxvk/dxvk_shader.h index 3ee179e93..e6ebd7a69 100644 --- a/src/dxvk/dxvk_shader.h +++ b/src/dxvk/dxvk_shader.h @@ -137,7 +137,7 @@ namespace dxvk { * Can be used to store the SPIR-V code in a file. * \param [in] outputStream Stream to write to */ - void dump(std::ostream&& outputStream) const; + void dump(std::ostream& outputStream) const; /** * \brief Reads SPIR-V shader @@ -145,7 +145,7 @@ namespace dxvk { * Can be used to replace the compiled SPIR-V code. * \param [in] inputStream Stream to read from */ - void read(std::istream&& inputStream); + void read(std::istream& inputStream); /** * \brief Sets the shader's debug name diff --git a/src/spirv/spirv_code_buffer.cpp b/src/spirv/spirv_code_buffer.cpp index bb6e41d35..7a577f34b 100644 --- a/src/spirv/spirv_code_buffer.cpp +++ b/src/spirv/spirv_code_buffer.cpp @@ -16,7 +16,7 @@ namespace dxvk { } - SpirvCodeBuffer::SpirvCodeBuffer(std::istream&& stream) { + SpirvCodeBuffer::SpirvCodeBuffer(std::istream& stream) { stream.ignore(std::numeric_limits::max()); std::streamsize length = stream.gcount(); stream.clear(); @@ -122,7 +122,7 @@ namespace dxvk { } - void SpirvCodeBuffer::store(std::ostream&& stream) const { + void SpirvCodeBuffer::store(std::ostream& stream) const { stream.write( reinterpret_cast(m_code.data()), sizeof(uint32_t) * m_code.size()); diff --git a/src/spirv/spirv_code_buffer.h b/src/spirv/spirv_code_buffer.h index cfd40f74d..dc3425380 100644 --- a/src/spirv/spirv_code_buffer.h +++ b/src/spirv/spirv_code_buffer.h @@ -22,7 +22,7 @@ namespace dxvk { SpirvCodeBuffer(); SpirvCodeBuffer(uint32_t size, const uint32_t* data); - SpirvCodeBuffer(std::istream&& stream); + SpirvCodeBuffer(std::istream& stream); template SpirvCodeBuffer(const uint32_t (&data)[N]) @@ -146,7 +146,7 @@ namespace dxvk { * exists mostly for debugging purposes. * \param [in] stream Output stream */ - void store(std::ostream&& stream) const; + void store(std::ostream& stream) const; /** * \brief Retrieves current insertion pointer