summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-09-28 17:05:34 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-09-28 17:05:34 +0200
commit85fe6ecc32ace7fcf119d9b492e37cd627ae7e4d (patch)
treef6f386733d5ecc86364fffeef7402dc2af0227dd /drivers
parent14e1f36e614686f3fea0c74fac3624d1027dd5cc (diff)
Fix MSVC warnings C4701 and C4703: Potentially uninitialized variable used
Diffstat (limited to 'drivers')
-rw-r--r--drivers/vulkan/rendering_device_vulkan.cpp4
-rw-r--r--drivers/vulkan/vulkan_context.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp
index 53e9146f85..bfe34399ec 100644
--- a/drivers/vulkan/rendering_device_vulkan.cpp
+++ b/drivers/vulkan/rendering_device_vulkan.cpp
@@ -4828,7 +4828,7 @@ Vector<uint8_t> RenderingDeviceVulkan::shader_compile_binary_from_spirv(const Ve
for (uint32_t j = 0; j < binding_count; j++) {
const SpvReflectDescriptorBinding &binding = *bindings[j];
- RenderingDeviceVulkanShaderBinaryDataBinding info;
+ RenderingDeviceVulkanShaderBinaryDataBinding info{};
bool need_array_dimensions = false;
bool need_block_size = false;
@@ -4979,7 +4979,7 @@ Vector<uint8_t> RenderingDeviceVulkan::shader_compile_binary_from_spirv(const Ve
for (uint32_t j = 0; j < sc_count; j++) {
int32_t existing = -1;
- RenderingDeviceVulkanShaderBinarySpecializationConstant sconst;
+ RenderingDeviceVulkanShaderBinarySpecializationConstant sconst{};
SpvReflectSpecializationConstant *spc = spec_constants[j];
sconst.constant_id = spc->constant_id;
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index 99ef57abae..98adc0f16e 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -608,10 +608,10 @@ Error VulkanContext::_check_capabilities() {
device_properties_func = (PFN_vkGetPhysicalDeviceProperties2)vkGetInstanceProcAddr(inst, "vkGetPhysicalDeviceProperties2KHR");
}
if (device_properties_func != nullptr) {
- VkPhysicalDeviceFragmentShadingRatePropertiesKHR vrsProperties;
- VkPhysicalDeviceMultiviewProperties multiviewProperties;
- VkPhysicalDeviceSubgroupProperties subgroupProperties;
- VkPhysicalDeviceProperties2 physicalDeviceProperties;
+ VkPhysicalDeviceFragmentShadingRatePropertiesKHR vrsProperties{};
+ VkPhysicalDeviceMultiviewProperties multiviewProperties{};
+ VkPhysicalDeviceSubgroupProperties subgroupProperties{};
+ VkPhysicalDeviceProperties2 physicalDeviceProperties{};
void *nextptr = nullptr;
subgroupProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_PROPERTIES;