From 948d72e079eba67ca2b12e21e987ab2a373eab92 Mon Sep 17 00:00:00 2001 From: Chris Galvan Date: Tue, 18 Jan 2022 16:22:25 -0600 Subject: [PATCH] Fixed logic error for iterating through the image data by region Signed-off-by: Chris Galvan --- .../Source/RPI.Reflect/Image/StreamingImageAsset.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp index 4e664ad3e2..d9aa2f1c23 100644 --- a/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp +++ b/Gems/Atom/RPI/Code/Source/RPI.Reflect/Image/StreamingImageAsset.cpp @@ -285,9 +285,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -311,9 +311,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x; @@ -337,9 +337,9 @@ namespace AZ auto width = imageDescriptor.m_size.m_width; size_t outValuesIndex = 0; - for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) + for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) { - for (uint32_t y = topLeft.second; y <= bottomRight.second; ++y) + for (uint32_t x = topLeft.first; x <= bottomRight.first; ++x) { size_t imageDataIndex = (y * width) + x;