Updated all array_view uses with the C++20 span. (#7157)
* Updated all array_view uses with the C++20 span. The updates were done in the following order 1. `AZStd::array_view<([^>].+)\* ?>` -> `AZStd::span<\1 const>` 2. `AZStd::array_view<(?:const )(.+)>` -> `AZStd::span<const \1>` 3. `AZStd::array_view` -> `AZStd::span` Removed the implementation of array_view. Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com> * Added missing whitespace between `const` and the typename for spans. Updated the ShaderTest comparison of the ShaderResourceGroupLayout span to compare the sizes as well Updated comments on some of the methods that stated that they return "an array" to mention they return "a span". Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
48cea89910
commit
b9824ed172
@@ -94,11 +94,11 @@ namespace AZ
|
||||
return m_totalImageDataSize;
|
||||
}
|
||||
|
||||
AZStd::array_view<uint8_t> StreamingImageAsset::GetSubImageData(uint32_t mip, uint32_t slice)
|
||||
AZStd::span<const uint8_t> StreamingImageAsset::GetSubImageData(uint32_t mip, uint32_t slice)
|
||||
{
|
||||
if (mip >= m_mipLevelToChainIndex.size())
|
||||
{
|
||||
return AZStd::array_view<uint8_t>();
|
||||
return AZStd::span<const uint8_t>();
|
||||
}
|
||||
|
||||
size_t mipChainIndex = m_mipLevelToChainIndex[mip];
|
||||
@@ -119,7 +119,7 @@ namespace AZ
|
||||
if (mipChainAsset == nullptr)
|
||||
{
|
||||
AZ_Warning("Streaming Image", false, "MipChain asset wasn't loaded");
|
||||
return AZStd::array_view<uint8_t>();
|
||||
return AZStd::span<const uint8_t>();
|
||||
}
|
||||
|
||||
return mipChainAsset->GetSubImageData(mip - mipChain.m_mipOffset, slice);
|
||||
|
||||
Reference in New Issue
Block a user