/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Texture/TexConv/Implementation/Texture2DArray.cpp
40 строк
1 KB
Jan Krassnigg
Added support for 2D array textures (#1905)
15 апр 2026, 13:03
Не верифицирован
15 апр 2026, 13:03
a17042f
Код
Авторство
О чём код?
#include <Texture/TexturePCH.h> #include <Foundation/Profiling/Profiling.h> #include <Texture/TexConv/TexConvProcessor.h> ezResult ezTexConvProcessor::Assemble2DArrayTexture(ezImage& dst) const { EZ_PROFILE_SCOPE("Assemble2DArrayTexture"); const auto& mappings = m_Descriptor.m_ChannelMappings; const ezUInt32 uiNumSlices = mappings.GetCount(); if (uiNumSlices == 0) { ezLog::Error("No channel mappings provided for 2D array texture assembly. Need at least one slice."); return EZ_FAILURE; } const ezUInt32 uiWidth = m_Descriptor.m_InputImages[0].GetWidth(); const ezUInt32 uiHeight = m_Descriptor.m_InputImages[0].GetHeight(); ezImageHeader header; header.SetWidth(uiWidth); header.SetHeight(uiHeight); header.SetDepth(1); header.SetNumFaces(1); header.SetNumMipLevels(1); header.SetNumArrayIndices(uiNumSlices); header.SetImageFormat(ezImageFormat::R32G32B32A32_FLOAT); dst.ResetAndAlloc(header); for (ezUInt32 uiSlice = 0; uiSlice < uiNumSlices; ++uiSlice) { ezColor* pPixelOut = dst.GetPixelPointer<ezColor>(0, 0, uiSlice); EZ_SUCCEED_OR_RETURN(Assemble2DSlice(mappings[uiSlice], uiWidth, uiHeight, pPixelOut)); } return EZ_SUCCESS; }