Skip to content

Commit

Permalink
Remove vkFormatToTextureFormat
Browse files Browse the repository at this point in the history
Summary: it's a duplicate function

Reviewed By: dmannemela, rameshviswanathan

Differential Revision: D62811383

fbshipit-source-id: 5bff94f9e8b9a92db3bc8613ea7196b7b24918fb
  • Loading branch information
francoiscoulombe authored and facebook-github-bot committed Sep 19, 2024
1 parent 0de174f commit 6351f31
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
3 changes: 2 additions & 1 deletion shell/openxr/mobile/vulkan/XrSwapchainProviderImplVulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <igl/vulkan/VulkanDevice.h>
#include <igl/vulkan/VulkanImage.h>
#include <igl/vulkan/VulkanImageView.h>
#include <igl/vulkan/util/TextureFormat.h>

#include <shell/openxr/XrLog.h>

Expand Down Expand Up @@ -97,7 +98,7 @@ std::shared_ptr<igl::ITexture> getSurfaceTexture(
}

const auto& actualDevice = static_cast<igl::vulkan::Device&>(device);
const auto iglFormat = vulkan::vkFormatToTextureFormat(externalTextureFormat);
const auto iglFormat = vulkan::util::vkTextureFormatToTextureFormat(externalTextureFormat);
const auto texture = inOutTextures[imageIndex];
// allocate new drawable textures if its null or mismatches in size or format
if (!texture || swapchainImageInfo.imageWidth != texture->getSize().width ||
Expand Down
4 changes: 0 additions & 4 deletions src/igl/vulkan/Common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,6 @@ igl::ColorSpace vkColorSpaceToColorSpace(VkColorSpaceKHR colorSpace) {
}
}

igl::TextureFormat vkFormatToTextureFormat(VkFormat format) {
return util::vkTextureFormatToTextureFormat(format);
}

VkMemoryPropertyFlags resourceStorageToVkMemoryPropertyFlags(igl::ResourceStorage resourceStorage) {
VkMemoryPropertyFlags memFlags{0};

Expand Down
5 changes: 3 additions & 2 deletions src/igl/vulkan/PlatformDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <igl/vulkan/Texture.h>
#include <igl/vulkan/VulkanContext.h>
#include <igl/vulkan/VulkanSwapchain.h>
#include <igl/vulkan/util/TextureFormat.h>

#if defined(IGL_ANDROID_HWBUFFER_SUPPORTED)
#include <android/hardware_buffer.h>
Expand Down Expand Up @@ -45,7 +46,7 @@ std::shared_ptr<ITexture> PlatformDevice::createTextureFromNativeDepth(uint32_t
IGL_ASSERT_MSG(vkTex->getVulkanImage().imageFormat_ != VK_FORMAT_UNDEFINED,
"Invalid image format");

const auto iglFormat = vkFormatToTextureFormat(vkTex->getVulkanImage().imageFormat_);
const auto iglFormat = util::vkTextureFormatToTextureFormat(vkTex->getVulkanImage().imageFormat_);
if (!IGL_VERIFY(iglFormat != igl::TextureFormat::Invalid)) {
Result::setResult(outResult, Result::Code::RuntimeError, "Invalid surface depth format");
return nullptr;
Expand Down Expand Up @@ -92,7 +93,7 @@ std::shared_ptr<ITexture> PlatformDevice::createTextureFromNativeDrawable(Result
IGL_ASSERT_MSG(vkTex->getVulkanImage().imageFormat_ != VK_FORMAT_UNDEFINED,
"Invalid image format");

const auto iglFormat = vkFormatToTextureFormat(vkTex->getVulkanImage().imageFormat_);
const auto iglFormat = util::vkTextureFormatToTextureFormat(vkTex->getVulkanImage().imageFormat_);
if (!IGL_VERIFY(iglFormat != igl::TextureFormat::Invalid)) {
Result::setResult(outResult, Result::Code::RuntimeError, "Invalid surface color format");
return nullptr;
Expand Down
10 changes: 5 additions & 5 deletions src/igl/vulkan/VulkanSwapchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ VulkanSwapchain::VulkanSwapchain(VulkanContext& ctx, uint32_t width, uint32_t he
surfaceFormat_ = chooseSwapSurfaceFormat(ctx.deviceSurfaceFormats_,
ctx.config_.requestedSwapChainTextureFormat,
ctx.config_.swapChainColorSpace);
IGL_LOG_DEBUG(
"Swapchain format: %s; colorSpace: %s\n",
TextureFormatProperties::fromTextureFormat(vkFormatToTextureFormat(surfaceFormat_.format))
.name,
colorSpaceToString(vkColorSpaceToColorSpace(surfaceFormat_.colorSpace)));
IGL_LOG_DEBUG("Swapchain format: %s; colorSpace: %s\n",
TextureFormatProperties::fromTextureFormat(
util::vkTextureFormatToTextureFormat(surfaceFormat_.format))
.name,
colorSpaceToString(vkColorSpaceToColorSpace(surfaceFormat_.colorSpace)));

IGL_ASSERT_MSG(
ctx.vkSurface_ != VK_NULL_HANDLE,
Expand Down

0 comments on commit 6351f31

Please sign in to comment.