Skip to content

Commit

Permalink
2 small fixes:
Browse files Browse the repository at this point in the history
* Raise error in GLUpload on attempted upload of universal texture.
* In ktx2check don't combine FLOAT & NORM when checking VK_FORMAT name.
  • Loading branch information
MarkCallow committed Apr 8, 2021
1 parent df3f140 commit 50000ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/glloader.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,9 @@ ktxTexture2_GLUpload(ktxTexture2* This, GLuint* pTexture, GLenum* pTarget,
return KTX_INVALID_OPERATION;
}
} else {
// TODO Check DFD for ASTC HDR or 3D or RGB[DEM] and figure out format.
// TODO: Check DFD for ASTC HDR or 3D or RGB[DEM] and figure out format.
return KTX_INVALID_OPERATION; // BasisU textures must be transcoded
// before upload.
}

formatInfo.glFormat = glGetFormatFromInternalFormat(formatInfo.glInternalformat);
Expand Down
5 changes: 4 additions & 1 deletion tools/ktx2check/ktx2check.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1439,7 +1439,10 @@ ktxValidator::validateDfd(validationContext& ctx)

if (result & i_FLOAT_FORMAT_BIT)
findStr += "FLOAT";
if (result & i_NORMALIZED_FORMAT_BIT)
// else here because Vulkan format names do not reflect
// both normalized and float. E.g, BC6H is just
// VK_FORMAT_BC6H_[SU]FLOAT_BLOCK.
else if (result & i_NORMALIZED_FORMAT_BIT)
findStr += "NORM";
else
findStr += "INT";
Expand Down

0 comments on commit 50000ca

Please sign in to comment.