mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
vulkan: Fix all warnings in VKGSRender project.
This commit is contained in:
parent
70903d46e6
commit
77674be1c1
8 changed files with 28 additions and 23 deletions
|
@ -259,7 +259,7 @@ namespace
|
|||
|
||||
VkRenderPassCreateInfo rp_info = {};
|
||||
rp_info.sType = VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO;
|
||||
rp_info.attachmentCount = attachments.size();
|
||||
rp_info.attachmentCount = static_cast<uint32_t>(attachments.size());
|
||||
rp_info.pAttachments = attachments.data();
|
||||
rp_info.subpassCount = 1;
|
||||
rp_info.pSubpasses = &subpass;
|
||||
|
@ -337,7 +337,7 @@ namespace
|
|||
VkDescriptorSetLayoutCreateInfo infos = {};
|
||||
infos.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO;
|
||||
infos.pBindings = bindings.data();
|
||||
infos.bindingCount = bindings.size();
|
||||
infos.bindingCount = static_cast<uint32_t>(bindings.size());
|
||||
|
||||
VkDescriptorSetLayout set_layout;
|
||||
CHECK_RESULT(vkCreateDescriptorSetLayout(dev, &infos, nullptr, &set_layout));
|
||||
|
@ -419,7 +419,7 @@ VKGSRender::VKGSRender() : GSRender(frame_type::Vulkan)
|
|||
|
||||
std::vector<VkDescriptorPoolSize> sizes{ uniform_buffer_pool, uniform_texel_pool, texture_pool };
|
||||
|
||||
descriptor_pool.create(*m_device, sizes.data(), sizes.size());
|
||||
descriptor_pool.create(*m_device, sizes.data(), static_cast<uint32_t>(sizes.size()));
|
||||
|
||||
|
||||
null_buffer = std::make_unique<vk::buffer>(*m_device, 32, m_memory_type_mapping.host_visible_coherent, VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, 0);
|
||||
|
@ -438,7 +438,7 @@ VKGSRender::VKGSRender() : GSRender(frame_type::Vulkan)
|
|||
|
||||
VKGSRender::~VKGSRender()
|
||||
{
|
||||
CHECK_RESULT(vkQueueWaitIdle(m_swap_chain->get_present_queue()));
|
||||
vkQueueWaitIdle(m_swap_chain->get_present_queue());
|
||||
|
||||
if (m_present_semaphore)
|
||||
{
|
||||
|
@ -1002,7 +1002,7 @@ void VKGSRender::close_and_submit_command_buffer(const std::vector<VkSemaphore>
|
|||
infos.pCommandBuffers = &cmd;
|
||||
infos.pWaitDstStageMask = &pipe_stage_flags;
|
||||
infos.pWaitSemaphores = semaphores.data();
|
||||
infos.waitSemaphoreCount = semaphores.size();
|
||||
infos.waitSemaphoreCount = static_cast<uint32_t>(semaphores.size());
|
||||
infos.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
|
||||
|
||||
CHECK_RESULT(vkQueueSubmit(m_swap_chain->get_present_queue(), 1, &infos, fence));
|
||||
|
@ -1071,7 +1071,7 @@ void VKGSRender::prepare_rtts()
|
|||
fbo_images.push_back(std::make_unique<vk::image_view>(*m_device, raw->value, VK_IMAGE_VIEW_TYPE_2D, raw->info.format, vk::default_component_map(), subres));
|
||||
}
|
||||
|
||||
m_draw_buffers_count = fbo_images.size();
|
||||
m_draw_buffers_count = static_cast<u32>(fbo_images.size());
|
||||
|
||||
if (std::get<1>(m_rtts.m_bound_depth_stencil) != nullptr)
|
||||
{
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace vk
|
|||
result.device_local = VK_MAX_MEMORY_TYPES;
|
||||
result.host_visible_coherent = VK_MAX_MEMORY_TYPES;
|
||||
|
||||
for (int i = 0; i < memory_properties.memoryTypeCount; i++)
|
||||
for (u32 i = 0; i < memory_properties.memoryTypeCount; i++)
|
||||
{
|
||||
bool is_device_local = !!(memory_properties.memoryTypes[i].propertyFlags & VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT);
|
||||
if (is_device_local)
|
||||
|
|
|
@ -181,7 +181,7 @@ namespace vk
|
|||
device.pNext = NULL;
|
||||
device.queueCreateInfoCount = 1;
|
||||
device.pQueueCreateInfos = &queue;
|
||||
device.enabledLayerCount = layers.size();
|
||||
device.enabledLayerCount = static_cast<uint32_t>(layers.size());
|
||||
device.ppEnabledLayerNames = layers.data();
|
||||
device.enabledExtensionCount = 1;
|
||||
device.ppEnabledExtensionNames = requested_extensions;
|
||||
|
@ -343,7 +343,7 @@ namespace vk
|
|||
VkImageType image_type,
|
||||
VkFormat format,
|
||||
uint32_t width, uint32_t height, uint32_t depth,
|
||||
VkDeviceSize mipmaps, VkDeviceSize layers,
|
||||
uint32_t mipmaps, uint32_t layers,
|
||||
VkSampleCountFlagBits samples,
|
||||
VkImageLayout initial_layout,
|
||||
VkImageTiling tiling,
|
||||
|
@ -496,7 +496,7 @@ namespace vk
|
|||
vkDestroyBuffer(m_device, value, nullptr);
|
||||
}
|
||||
|
||||
void *map(u32 offset, u64 size)
|
||||
void *map(u64 offset, u64 size)
|
||||
{
|
||||
void *data = nullptr;
|
||||
CHECK_RESULT(vkMapMemory(m_device, memory->memory, offset, size, 0, &data));
|
||||
|
@ -604,7 +604,7 @@ namespace vk
|
|||
info.sType = VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO;
|
||||
info.width = width;
|
||||
info.height = height;
|
||||
info.attachmentCount = image_view_array.size();
|
||||
info.attachmentCount = static_cast<uint32_t>(image_view_array.size());
|
||||
info.pAttachments = image_view_array.data();
|
||||
info.renderPass = pass;
|
||||
info.layers = 1;
|
||||
|
@ -1044,7 +1044,7 @@ namespace vk
|
|||
VkInstanceCreateInfo instance_info = {};
|
||||
instance_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
|
||||
instance_info.pApplicationInfo = &app;
|
||||
instance_info.enabledLayerCount = layers.size();
|
||||
instance_info.enabledLayerCount = static_cast<uint32_t>(layers.size());
|
||||
instance_info.ppEnabledLayerNames = layers.data();
|
||||
instance_info.enabledExtensionCount = 3;
|
||||
instance_info.ppEnabledExtensionNames = requested_extensions;
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace rsx
|
|||
rtt.reset(new vk::image(device, mem_mapping.device_local,
|
||||
VK_IMAGE_TYPE_2D,
|
||||
requested_format,
|
||||
width, height, 1, 1, 1,
|
||||
static_cast<uint32_t>(width), static_cast<uint32_t>(height), 1, 1, 1,
|
||||
VK_SAMPLE_COUNT_1_BIT,
|
||||
VK_IMAGE_LAYOUT_UNDEFINED,
|
||||
VK_IMAGE_TILING_OPTIMAL,
|
||||
|
@ -55,7 +55,7 @@ namespace rsx
|
|||
|
||||
std::unique_ptr<vk::image> ds;
|
||||
ds.reset(new vk::image(device, mem_mapping.device_local,
|
||||
VK_IMAGE_TYPE_2D, requested_format, width, height, 1, 1, 1, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT|VK_IMAGE_USAGE_SAMPLED_BIT, 0));
|
||||
VK_IMAGE_TYPE_2D, requested_format, static_cast<uint32_t>(width), static_cast<uint32_t>(height), 1, 1, 1, VK_SAMPLE_COUNT_1_BIT, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT|VK_IMAGE_USAGE_SAMPLED_BIT, 0));
|
||||
change_image_layout(*cmd, ds->value, VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_GENERAL, range);
|
||||
|
||||
//Clear new surface..
|
||||
|
|
|
@ -138,7 +138,7 @@ namespace vk
|
|||
for (const rsx_subresource_layout &layout : subresource_layout)
|
||||
{
|
||||
u32 row_pitch = align(layout.width_in_block * block_size_in_bytes, 256);
|
||||
size_t image_linear_size = row_pitch * layout.height_in_block * layout.depth;
|
||||
u32 image_linear_size = row_pitch * layout.height_in_block * layout.depth;
|
||||
size_t offset_in_buffer = upload_heap.alloc<512>(image_linear_size);
|
||||
|
||||
void *mapped_buffer = upload_buffer->map(offset_in_buffer, image_linear_size);
|
||||
|
|
|
@ -119,12 +119,12 @@ namespace vk
|
|||
obj.protected_rgn_end = (u32)align(obj.native_rsx_size, memory_page_size);
|
||||
obj.protected_rgn_end += obj.protected_rgn_start;
|
||||
|
||||
lock_memory_region(obj.protected_rgn_start, obj.native_rsx_size);
|
||||
lock_memory_region(static_cast<u32>(obj.protected_rgn_start), static_cast<u32>(obj.native_rsx_size));
|
||||
}
|
||||
|
||||
void unlock_object(cached_texture_object &obj)
|
||||
{
|
||||
unlock_memory_region(obj.protected_rgn_start, obj.native_rsx_size);
|
||||
unlock_memory_region(static_cast<u32>(obj.protected_rgn_start), static_cast<u32>(obj.native_rsx_size));
|
||||
}
|
||||
|
||||
void purge_dirty_textures()
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace vk
|
|||
indices[i] = i;
|
||||
|
||||
indices[i] = 0;
|
||||
return indices.size();
|
||||
return static_cast<u32>(indices.size());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
@ -112,7 +112,7 @@ namespace vk
|
|||
indices[i] = original_indices[i];
|
||||
|
||||
indices[i] = original_indices[0];
|
||||
return indices.size();
|
||||
return static_cast<u32>(indices.size());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -454,7 +454,7 @@ VKGSRender::upload_vertex_data()
|
|||
{
|
||||
case rsx::vertex_base_type::f:
|
||||
{
|
||||
const u32 num_stored_verts = data_size / (sizeof(float) * vertex_info.size);
|
||||
const u32 num_stored_verts = static_cast<u32>(data_size / (sizeof(float) * vertex_info.size));
|
||||
vk::expand_array_components<float, 3, 4, 1>(reinterpret_cast<float*>(vertex_data.data()), converted_buffer, num_stored_verts);
|
||||
break;
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ VKGSRender::upload_vertex_data()
|
|||
}
|
||||
else
|
||||
{
|
||||
index_count = get_index_count(draw_mode, vertex_draw_count);
|
||||
index_count = static_cast<u32>(get_index_count(draw_mode, vertex_draw_count));
|
||||
std::vector<u16> indices(index_count);
|
||||
|
||||
if (is_indexed_draw)
|
||||
|
@ -568,7 +568,7 @@ VKGSRender::upload_vertex_data()
|
|||
index_format = VK_INDEX_TYPE_UINT16;
|
||||
VkFormat fmt = VK_FORMAT_R16_UINT;
|
||||
|
||||
u32 elem_size = get_index_type_size(indexed_type);
|
||||
u32 elem_size = static_cast<u32>(get_index_type_size(indexed_type));
|
||||
|
||||
if (indexed_type == rsx::index_array_type::u32)
|
||||
{
|
||||
|
@ -576,7 +576,7 @@ VKGSRender::upload_vertex_data()
|
|||
fmt = VK_FORMAT_R32_UINT;
|
||||
}
|
||||
|
||||
u32 index_sz = vertex_index_array.size() / elem_size;
|
||||
u32 index_sz = static_cast<u32>(vertex_index_array.size()) / elem_size;
|
||||
if (index_sz != vertex_draw_count)
|
||||
LOG_ERROR(RSX, "Vertex draw count mismatch!");
|
||||
|
||||
|
|
|
@ -100,6 +100,7 @@
|
|||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
@ -115,6 +116,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
@ -125,16 +127,19 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release - LLVM|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - MemLeak|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug - LLVM|x64'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>..\Vulkan\Vulkan-LoaderAndValidationLayers\include;..\Vulkan\glslang\glslang\Public;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<TreatWarningAsError>true</TreatWarningAsError>
|
||||
</ClCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
Loading…
Add table
Reference in a new issue