From 7557909ea5fbadb014643c43ce009f5555d6c16a Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 2 Jul 2019 19:52:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=BB=93=E6=9E=84=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=A1=AB=E5=85=85=EF=BC=8C=E5=A5=BD=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/Vulkan/texture_rect.cpp | 30 ++++++++++++------- .../Vulkan/VKDeviceRenderPass.cpp | 1 + 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/example/Vulkan/texture_rect.cpp b/example/Vulkan/texture_rect.cpp index 73f45d84..7d2efd3a 100644 --- a/example/Vulkan/texture_rect.cpp +++ b/example/Vulkan/texture_rect.cpp @@ -94,18 +94,26 @@ private: texture=vulkan::LoadTGATexture(OS_TEXT("lena.tga"),device); - VkSamplerCreateInfo sampler_create_info{}; + VkSamplerCreateInfo sampler_create_info; - sampler_create_info.magFilter = VK_FILTER_LINEAR; - sampler_create_info.minFilter = VK_FILTER_LINEAR; - sampler_create_info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; - sampler_create_info.addressModeU= VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - sampler_create_info.addressModeV= VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - sampler_create_info.addressModeW= VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; - sampler_create_info.mipLodBias = 0.0f; - sampler_create_info.compareOp = VK_COMPARE_OP_NEVER; - sampler_create_info.minLod = 0.0f; - sampler_create_info.maxLod = 1.0f; + sampler_create_info.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; + sampler_create_info.pNext = nullptr; + sampler_create_info.flags = 0; + sampler_create_info.magFilter = VK_FILTER_LINEAR; + sampler_create_info.minFilter = VK_FILTER_LINEAR; + sampler_create_info.mipmapMode = VK_SAMPLER_MIPMAP_MODE_LINEAR; + sampler_create_info.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + sampler_create_info.addressModeV = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + sampler_create_info.addressModeW = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; + sampler_create_info.mipLodBias = 0.0f; + sampler_create_info.anisotropyEnable = false; + sampler_create_info.maxAnisotropy = 0; + sampler_create_info.compareEnable = false; + sampler_create_info.compareOp = VK_COMPARE_OP_NEVER; + sampler_create_info.minLod = 0.0f; + sampler_create_info.maxLod = 1.0f; + sampler_create_info.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK; + sampler_create_info.unnormalizedCoordinates = false; sampler=device->CreateSampler(&sampler_create_info); diff --git a/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp b/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp index f63f0ba0..76c85c6e 100644 --- a/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp +++ b/src/RenderDevice/Vulkan/VKDeviceRenderPass.cpp @@ -19,6 +19,7 @@ RenderPass *Device::CreateRenderPass(List color_format,VkFormat depth_ for(uint i=0;i