mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-09 10:47:53 +02:00
Update imageOffset to size_t
This commit is contained in:
parent
47cf44dc60
commit
cb299695f4
3 changed files with 6 additions and 7 deletions
|
@ -97,7 +97,6 @@ struct GPUKTXPayload {
|
|||
return false;
|
||||
}
|
||||
};
|
||||
const std::string gpu::SOURCE_HASH_KEY { "hifi.sourceHash" };
|
||||
const std::string GPUKTXPayload::KEY { "hifi.gpu" };
|
||||
|
||||
KtxStorage::KtxStorage(const std::string& filename) : _filename(filename) {
|
||||
|
|
|
@ -136,7 +136,7 @@ size_t KTXDescriptor::getValueOffsetForKey(const std::string& key) const {
|
|||
ImageDescriptors Header::generateImageDescriptors() const {
|
||||
ImageDescriptors descriptors;
|
||||
|
||||
uint32_t imageOffset = 0;
|
||||
size_t imageOffset = 0;
|
||||
for (uint32_t level = 0; level < numberOfMipmapLevels; ++level) {
|
||||
auto imageSize = static_cast<uint32_t>(evalImageSize(level));
|
||||
if (imageSize == 0) {
|
||||
|
@ -149,7 +149,7 @@ ImageDescriptors Header::generateImageDescriptors() const {
|
|||
0
|
||||
};
|
||||
|
||||
imageOffset += (imageSize * numberOfFaces) + 4;
|
||||
imageOffset += (imageSize * numberOfFaces) + ktx::IMAGE_SIZE_WIDTH;
|
||||
|
||||
ImageHeader::FaceOffsets offsets;
|
||||
// TODO Add correct face offsets
|
||||
|
|
|
@ -422,11 +422,11 @@ namespace ktx {
|
|||
// This is the byte offset from the _start_ of the image region. For example, level 0
|
||||
// will have a byte offset of 0.
|
||||
const uint32_t _numFaces;
|
||||
const uint32_t _imageOffset;
|
||||
const size_t _imageOffset;
|
||||
const uint32_t _imageSize;
|
||||
const uint32_t _faceSize;
|
||||
const uint32_t _padding;
|
||||
ImageHeader(bool cube, uint32_t imageOffset, uint32_t imageSize, uint32_t padding) :
|
||||
ImageHeader(bool cube, size_t imageOffset, uint32_t imageSize, uint32_t padding) :
|
||||
_numFaces(cube ? NUM_CUBEMAPFACES : 1),
|
||||
_imageOffset(imageOffset),
|
||||
_imageSize(imageSize * _numFaces),
|
||||
|
@ -448,10 +448,10 @@ namespace ktx {
|
|||
struct Image : public ImageHeader {
|
||||
FaceBytes _faceBytes;
|
||||
Image(const ImageHeader& header, const FaceBytes& faces) : ImageHeader(header), _faceBytes(faces) {}
|
||||
Image(uint32_t imageOffset, uint32_t imageSize, uint32_t padding, const Byte* bytes) :
|
||||
Image(size_t imageOffset, uint32_t imageSize, uint32_t padding, const Byte* bytes) :
|
||||
ImageHeader(false, imageOffset, imageSize, padding),
|
||||
_faceBytes(1, bytes) {}
|
||||
Image(uint32_t imageOffset, uint32_t pageSize, uint32_t padding, const FaceBytes& cubeFaceBytes) :
|
||||
Image(size_t imageOffset, uint32_t pageSize, uint32_t padding, const FaceBytes& cubeFaceBytes) :
|
||||
ImageHeader(true, imageOffset, pageSize, padding)
|
||||
{
|
||||
if (cubeFaceBytes.size() == NUM_CUBEMAPFACES) {
|
||||
|
|
Loading…
Reference in a new issue