Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add debug reportingfor cubemap arrays, and correct transcription flaw #897

Merged
merged 1 commit into from Sep 18, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion Engine/source/gfx/gl/gfxGLCubemap.cpp
Expand Up @@ -340,6 +340,13 @@ void GFXGLCubemapArray::init(GFXCubemapHandle *cubemaps, const U32 cubemapCount)
for (U32 i = 0; i < cubemapCount; i++)
{
GFXGLCubemap* glTex = static_cast<GFXGLCubemap*>(cubemaps[i].getPointer());
//yes checking the first one(cubemap at index 0) is pointless but saves a further if statement
if (cubemaps[i]->getSize() != mSize || cubemaps[i]->getFormat() != mFormat || cubemaps[i]->getMipMapLevels() != mMipMapLevels)
{
Con::printf("Trying to add an invalid Cubemap to a CubemapArray");
//destroy array here first
AssertFatal(false, "GFXD3D11CubemapArray::initStatic - invalid cubemap");
}
for (U32 face = 0; face < 6; face++)
{
for (U32 currentMip = 0; currentMip < mMipMapLevels; currentMip++)
Expand Down Expand Up @@ -368,7 +375,7 @@ void GFXGLCubemapArray::init(GFXCubemapHandle *cubemaps, const U32 cubemapCount)
//Just allocate the cubemap array but we don't upload any data
void GFXGLCubemapArray::init(const U32 cubemapCount, const U32 cubemapFaceSize, const GFXFormat format)
{
setCubeTexSize(cubemapCount);
setCubeTexSize(cubemapFaceSize);
mFormat = format;
mNumCubemaps = cubemapCount;
const bool isCompressed = ImageUtil::isCompressedFormat(mFormat);
Expand Down