Fix all Windows warnings
diff --git a/src/backend/d3d12/CommandBufferD3D12.cpp b/src/backend/d3d12/CommandBufferD3D12.cpp
index 4a9a637..5de2b5b 100644
--- a/src/backend/d3d12/CommandBufferD3D12.cpp
+++ b/src/backend/d3d12/CommandBufferD3D12.cpp
@@ -273,7 +273,8 @@
                         D3D12_RECT scissorRect = { 0, 0, static_cast<long>(width), static_cast<long>(height) };
                         commandList->RSSetViewports(1, &viewport);
                         commandList->RSSetScissorRects(1, &scissorRect);
-                        commandList->OMSetRenderTargets(1, &device->GetCurrentRenderTargetDescriptor(), FALSE, nullptr);
+                        D3D12_CPU_DESCRIPTOR_HANDLE rtv = device->GetCurrentRenderTargetDescriptor();
+                        commandList->OMSetRenderTargets(1, &rtv, FALSE, nullptr);
                     }
                     break;
 
@@ -381,7 +382,7 @@
 
                 case Command::EndRenderPass:
                     {
-                        EndRenderPassCmd* cmd = commands.NextCommand<EndRenderPassCmd>();
+                        commands.NextCommand<EndRenderPassCmd>();
                     }
                     break;
 
@@ -426,13 +427,13 @@
 
                 case Command::SetPushConstants:
                     {
-                        SetPushConstantsCmd* cmd = commands.NextCommand<SetPushConstantsCmd>();
+                        commands.NextCommand<SetPushConstantsCmd>();
                     }
                     break;
 
                 case Command::SetStencilReference:
                     {
-                        SetStencilReferenceCmd* cmd = commands.NextCommand<SetStencilReferenceCmd>();
+                        commands.NextCommand<SetStencilReferenceCmd>();
                     }
                     break;
 
diff --git a/src/backend/d3d12/D3D12Backend.cpp b/src/backend/d3d12/D3D12Backend.cpp
index c87ad59..b330bce 100644
--- a/src/backend/d3d12/D3D12Backend.cpp
+++ b/src/backend/d3d12/D3D12Backend.cpp
@@ -200,10 +200,10 @@
             pendingCommands.open = false;
             lists[0] = pendingCommands.commandList.Get();
             std::copy(commandLists.begin(), commandLists.end(), lists.begin() + 1);
-            commandQueue->ExecuteCommandLists(commandLists.size() + 1, lists.data());
+            commandQueue->ExecuteCommandLists(static_cast<UINT>(commandLists.size() + 1), lists.data());
         } else {
             std::vector<ID3D12CommandList*> lists(commandLists);
-            commandQueue->ExecuteCommandLists(commandLists.size(), lists.data());
+            commandQueue->ExecuteCommandLists(static_cast<UINT>(commandLists.size()), lists.data());
         }
     }
 
diff --git a/src/backend/d3d12/InputStateD3D12.cpp b/src/backend/d3d12/InputStateD3D12.cpp
index 73b3acb..a02cd73 100644
--- a/src/backend/d3d12/InputStateD3D12.cpp
+++ b/src/backend/d3d12/InputStateD3D12.cpp
@@ -14,6 +14,8 @@
 
 #include "backend/d3d12/InputStateD3D12.h"
 
+#include "common/BitSetIterator.h"
+
 namespace backend {
 namespace d3d12 {
 
@@ -48,8 +50,8 @@
 
         const auto& attributesSetMask = GetAttributesSetMask();
 
-        size_t count = 0;
-        for (size_t i = 0; i < attributesSetMask.size(); ++i) {
+        unsigned int count = 0;
+        for (auto i : IterateBitSet(attributesSetMask)) {
             if (!attributesSetMask[i]) {
                 continue;
             }
@@ -60,7 +62,7 @@
 
             // If the HLSL semantic is TEXCOORDN the SemanticName should be "TEXCOORD" and the SemanticIndex N
             inputElementDescriptor.SemanticName = "TEXCOORD";
-            inputElementDescriptor.SemanticIndex = i;
+            inputElementDescriptor.SemanticIndex = static_cast<uint32_t>(i);
             inputElementDescriptor.Format = VertexFormatType(attribute.format);
             inputElementDescriptor.InputSlot = attribute.bindingSlot;
 
diff --git a/src/backend/d3d12/TextureD3D12.cpp b/src/backend/d3d12/TextureD3D12.cpp
index 432b5b8..49a08b9 100644
--- a/src/backend/d3d12/TextureD3D12.cpp
+++ b/src/backend/d3d12/TextureD3D12.cpp
@@ -89,8 +89,8 @@
         resourceDescriptor.Alignment = 0;
         resourceDescriptor.Width = GetWidth();
         resourceDescriptor.Height = GetHeight();
-        resourceDescriptor.DepthOrArraySize = GetDepth();
-        resourceDescriptor.MipLevels = GetNumMipLevels();
+        resourceDescriptor.DepthOrArraySize = static_cast<UINT16>(GetDepth());
+        resourceDescriptor.MipLevels = static_cast<UINT16>(GetNumMipLevels());
         resourceDescriptor.Format = D3D12TextureFormat(GetFormat());
         resourceDescriptor.SampleDesc.Count = 1;
         resourceDescriptor.SampleDesc.Quality = 0;