GPUTexture: Fix HDRI being clamped on OSX
Seems like GLEW_ARB_texture_float is not defined in core profile on OSX even if float textures are part of the 3.3 core spec. So removing uneeded backup cases.
This commit is contained in:
parent
e620380cc2
commit
5ada6e7540
|
@ -473,13 +473,11 @@ void GPU_create_gl_tex(
|
|||
|
||||
if (textarget == GL_TEXTURE_2D) {
|
||||
if (use_high_bit_depth) {
|
||||
if (GLEW_ARB_texture_float)
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16F, rectw, recth, 0, GL_RGBA, GL_FLOAT, frect);
|
||||
}
|
||||
else
|
||||
else {
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, rectw, recth, 0, GL_RGBA, GL_UNSIGNED_BYTE, rect);
|
||||
}
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gpu_get_mipmap_filter(1));
|
||||
|
||||
|
@ -502,10 +500,7 @@ void GPU_create_gl_tex(
|
|||
for (i = 1; i < ibuf->miptot; i++) {
|
||||
ImBuf *mip = ibuf->mipmap[i - 1];
|
||||
if (use_high_bit_depth) {
|
||||
if (GLEW_ARB_texture_float)
|
||||
glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16F, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
|
||||
else
|
||||
glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
|
||||
glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA16F, mip->x, mip->y, 0, GL_RGBA, GL_FLOAT, mip->rect_float);
|
||||
}
|
||||
else {
|
||||
glTexImage2D(GL_TEXTURE_2D, i, GL_RGBA8, mip->x, mip->y, 0, GL_RGBA, GL_UNSIGNED_BYTE, mip->rect);
|
||||
|
@ -525,7 +520,7 @@ void GPU_create_gl_tex(
|
|||
|
||||
if (h == w && is_power_of_2_i(h) && !is_over_resolution_limit(textarget, h, w)) {
|
||||
void **cube_map = gpu_gen_cube_map(rect, frect, rectw, recth, use_high_bit_depth);
|
||||
GLenum informat = use_high_bit_depth ? (GLEW_ARB_texture_float ? GL_RGBA16F : GL_RGBA16) : GL_RGBA8;
|
||||
GLenum informat = use_high_bit_depth ? GL_RGBA16F : GL_RGBA8;
|
||||
GLenum type = use_high_bit_depth ? GL_FLOAT : GL_UNSIGNED_BYTE;
|
||||
|
||||
if (cube_map)
|
||||
|
|
Loading…
Reference in New Issue