Merge "Fix bpp mismatch" into nyc-dev
This commit is contained in:
@@ -165,6 +165,10 @@ Texture* GradientCache::addLinearGradient(GradientCacheEntry& gradient,
|
||||
generateTexture(colors, positions, info.width, 2, texture);
|
||||
|
||||
mSize += size;
|
||||
LOG_ALWAYS_FATAL_IF((int)size != texture->objectSize(),
|
||||
"size != texture->objectSize(), size %" PRIu32 ", objectSize %" PRIu32
|
||||
" width = %" PRIu32 " bytesPerPixel() = %" PRIu32,
|
||||
size, texture->objectSize(), info.width, bytesPerPixel());
|
||||
mCache.put(gradient, texture);
|
||||
|
||||
return texture;
|
||||
|
||||
@@ -33,8 +33,11 @@ static int bytesPerPixel(GLint glFormat) {
|
||||
case GL_RGB:
|
||||
return 3;
|
||||
case GL_RGBA:
|
||||
default:
|
||||
return 4;
|
||||
case GL_RGBA16F:
|
||||
return 16;
|
||||
default:
|
||||
LOG_ALWAYS_FATAL("UNKNOWN FORMAT %d", glFormat);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user