OCIO: Fix mip length in texture creation
Also add an assert to avoid reproducing the error in the future.
This commit is contained in:
parent
9be720d85e
commit
1685b1dba4
|
@ -324,7 +324,7 @@ static bool addGPULut2D(OCIO_GPUTextures &textures,
|
|||
GPU_R16F;
|
||||
|
||||
OCIO_GPULutTexture lut;
|
||||
lut.texture = GPU_texture_create_2d(texture_name, width, height, 0, format, values);
|
||||
lut.texture = GPU_texture_create_2d(texture_name, width, height, 1, format, values);
|
||||
if (lut.texture == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
@ -356,7 +356,7 @@ static bool addGPULut3D(OCIO_GPUTextures &textures,
|
|||
|
||||
OCIO_GPULutTexture lut;
|
||||
lut.texture = GPU_texture_create_3d(
|
||||
texture_name, edgelen, edgelen, edgelen, 0, GPU_RGB16F, GPU_DATA_FLOAT, values);
|
||||
texture_name, edgelen, edgelen, edgelen, 1, GPU_RGB16F, GPU_DATA_FLOAT, values);
|
||||
if (lut.texture == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -192,6 +192,7 @@ static inline GPUTexture *gpu_texture_create(const char *name,
|
|||
eGPUDataFormat data_format,
|
||||
const void *pixels)
|
||||
{
|
||||
BLI_assert(mips > 0);
|
||||
Texture *tex = GPUBackend::get()->texture_alloc(name);
|
||||
bool success = false;
|
||||
switch (type) {
|
||||
|
|
Loading…
Reference in New Issue