diff --git a/src/d3d11/d3d11_device.cpp b/src/d3d11/d3d11_device.cpp index 5921637c..f126f95a 100644 --- a/src/d3d11/d3d11_device.cpp +++ b/src/d3d11/d3d11_device.cpp @@ -1360,8 +1360,7 @@ namespace dxvk { const Rc& adapter, D3D_FEATURE_LEVEL featureLevel) { VkPhysicalDeviceFeatures supported = adapter->features(); - VkPhysicalDeviceFeatures enabled; - std::memset(&enabled, 0, sizeof(enabled)); + VkPhysicalDeviceFeatures enabled = {}; if (featureLevel >= D3D_FEATURE_LEVEL_9_1) { enabled.depthClamp = VK_TRUE; @@ -1510,11 +1509,8 @@ namespace dxvk { image, subresources); } else { if (subresources.aspectMask == VK_IMAGE_ASPECT_COLOR_BIT) { - VkClearColorValue value; - std::memset(&value, 0, sizeof(value)); - m_resourceInitContext->clearColorImage( - image, value, subresources); + image, VkClearColorValue(), subresources); } else { VkClearDepthStencilValue value; value.depth = 1.0f; diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index accc9a00..d1588f8d 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -1020,9 +1020,6 @@ namespace dxvk { DxvkContextFlag::GpDirtyPipelineState, DxvkContextFlag::GpDirtyVertexBuffers); - m_state.gp.state.ilAttributeCount = attributeCount; - m_state.gp.state.ilBindingCount = bindingCount; - for (uint32_t i = 0; i < attributeCount; i++) { m_state.gp.state.ilAttributes[i].location = attributes[i].location; m_state.gp.state.ilAttributes[i].binding = attributes[i].binding; @@ -1030,18 +1027,19 @@ namespace dxvk { m_state.gp.state.ilAttributes[i].offset = attributes[i].offset; } - std::memset( - m_state.gp.state.ilAttributes + attributeCount, 0, - sizeof(VkVertexInputAttributeDescription) * (MaxNumVertexAttributes - attributeCount)); + for (uint32_t i = attributeCount; i < m_state.gp.state.ilAttributeCount; i++) + m_state.gp.state.ilAttributes[i] = VkVertexInputAttributeDescription(); for (uint32_t i = 0; i < bindingCount; i++) { m_state.gp.state.ilBindings[i].binding = bindings[i].binding; m_state.gp.state.ilBindings[i].inputRate = bindings[i].inputRate; } - std::memset( - m_state.gp.state.ilBindings + bindingCount, 0, - sizeof(VkVertexInputBindingDescription) * (MaxNumVertexBindings - bindingCount)); + for (uint32_t i = bindingCount; i < m_state.gp.state.ilBindingCount; i++) + m_state.gp.state.ilBindings[i] = VkVertexInputBindingDescription(); + + m_state.gp.state.ilAttributeCount = attributeCount; + m_state.gp.state.ilBindingCount = bindingCount; }