gfxstream: move variables into the #ifdef that uses them

../src/gfxstream/guest/vulkan_enc/ResourceTracker.cpp:7585:14: warning: unused variable ‘actualFormat’ [-Wunused-variable]
 7585 |     VkFormat actualFormat = imageInfo.createInfo.format;
      |              ^~~~~~~~~~~~

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36171>
This commit is contained in:
Eric Engestrom 2025-07-16 17:13:44 +02:00 committed by Marge Bot
parent 2308960bed
commit e39a41e104

View file

@ -7581,8 +7581,6 @@ void ResourceTracker::on_vkCmdClearColorImage(void* context, VkCommandBuffer com
return;
}
auto& imageInfo = imageInfoIt->second;
VkFormat actualFormat = imageInfo.createInfo.format;
VkClearColorValue convertedColor = *pColor;
#ifdef VK_USE_PLATFORM_ANDROID_KHR
@ -7590,6 +7588,8 @@ void ResourceTracker::on_vkCmdClearColorImage(void* context, VkCommandBuffer com
// it'll have the identical parameters, so we need to convert the linearized
// clear color back to sRGB at this point.
// TODO(b/420857458): revise the allocation logic to support mutable formats better
auto& imageInfo = imageInfoIt->second;
VkFormat actualFormat = imageInfo.createInfo.format;
if (imageInfo.hasAnb && srgbFormatNeedsConversionForClearColor(actualFormat)) {
// Perform linear to srgb conversion
// Backing image is UNORM for vkCmdClearColorImage so we convert pColor