GL_TEXTURE_2D_ARRAY wasn't handled in GPU_texture_update

Although the problem was exposed in 9457715d9a, the problem was in the
original code that was copied over. To have:

```
} else { /* EXPECTED_VALUE */
```

Without an BLI_assert(value == EXPECTED_VALUE); is asking for troubles.
Yet another reason to favour switch statements with:

```
default:
    BLI_assert(!"value not implemented or supported");
```

Instead of chained if/else if/else /* expected_value */.
This commit is contained in:
Dalai Felinto 2017-08-22 14:33:57 +02:00
parent 5f4066c87d
commit d7b3e33af4
1 changed files with 1 additions and 0 deletions

View File

@ -732,6 +732,7 @@ void GPU_texture_update(GPUTexture *tex, const float *pixels)
glTexSubImage1D(tex->target, 0, 0, tex->w, format, data_format, pixels);
break;
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
glTexSubImage3D(tex->target, 0, 0, 0, 0, tex->w, tex->h, tex->d, format, data_format, pixels);
break;
default: