protonscr

Error build on clang (mingw-w64-llvm)

dxvkclosed
doitsujin/dxvk#4734 · opened 2025-03-05 by Terromur · updated 2025-03-05 · 2 comments · github
TTerromur 2025-03-05 github

Problem building dxvk on clang compiler. The problem appeared due to commit: url

System information

  • System: Arch Linux
  • mingw-w64-llvm-bin: url
  • DXVK version: 2.5.3.r239.gd04fe1cdc

Log files

Options for solving problems I've found:

  1. Ignore a commit that has a problem, then the build will build successfully
  2. Change the code a bit to make the build succeed too (not recommended, as we are fooling the compiler rather than fixing the problem completely)
       // Write the data directly to the CS chunk.
-       uint32_t dwordCount = Length / sizeof(uint32_t);
+	uint64_t dwordCount = Length / sizeof(uint64_t);
 
-      EmitCsCmd<uint32_t>(D3D11CmdType::None, dwordCount, [
+      EmitCsCmd<uint64_t>(D3D11CmdType::None, dwordCount, [
         cBufferSlice = std::move(bufferSlice)
-      ] (DxvkContext* ctx, const uint32_t* data, size_t) {
+      ] (DxvkContext* ctx, const uint64_t* data, size_t) {
         ctx->updateBuffer(
           cBufferSlice.buffer(),
           cBufferSlice.offset(),
@@ -5521,11 +5521,11 @@
 
       // Compiler should be able to vectorize here, but GCC only does
       // if we cast the destination pointer to the correct type first
-      auto src = reinterpret_cast<const uint32_t*>(pSrcData);
-      auto dst = reinterpret_cast<uint32_t*>(m_csData->first());
+      auto src = reinterpret_cast<const uint64_t*>(pSrcData);
+      auto dst = reinterpret_cast<uint64_t*>(m_csData->first());
 
-      for (uint32_t i = 0; i < dwordCount; i++)
-        new (dst + i) uint32_t(src[i]);
+      for (uint64_t i = 0; i < dwordCount; i++)
+        new (dst + i) uint64_t(src[i]);
     } else {
       // Write directly to a staging buffer and dispatch a copy
       DxvkBufferSlice stagingSlice = AllocStagingBuffer(Length);```

Ddoitsujin maintainer 2025-03-05 github

Please try #4735, that should be a proper fix.

TTerromur 2025-03-05 github

Please try [#4735](https://github.com/doitsujin/dxvk/pull/4735), that should be a proper fix.

It works, thank you!

Upstream links