Shader:sendImage only checks srgb flag for RGBA textures;

It doesn't need to check it for RGB and compressed textures because
those are already rejected.

It may also be a good idea to zero-out the srgb flag for formats that
it doesn't apply to.
This commit is contained in:
bjorn 2020-08-18 20:20:48 -06:00
parent d937be35b5
commit 80f9514295
1 changed files with 1 additions and 1 deletions

View File

@ -767,7 +767,7 @@ static void lovrGpuBindImage(Image* image, int slot, const char* name) {
if (memcmp(state.images + slot, image, sizeof(Image))) {
Texture* texture = image->texture;
lovrAssert(texture, "No Texture bound to image uniform '%s'", name);
lovrAssert(!texture->srgb, "Attempt to bind sRGB texture to image uniform '%s'", name);
lovrAssert(texture->format != FORMAT_RGBA || !texture->srgb, "Attempt to bind sRGB texture to image uniform '%s'", name);
lovrAssert(!isTextureFormatCompressed(texture->format), "Attempt to bind compressed texture to image uniform '%s'", name);
lovrAssert(texture->format != FORMAT_RGB && texture->format != FORMAT_RGBA4 && texture->format != FORMAT_RGB5A1, "Unsupported texture format for image uniform '%s'", name);
lovrAssert(image->mipmap < (int) texture->mipmapCount, "Invalid mipmap level '%d' for image uniform '%s'", image->mipmap, name);