fix mixer on iOS, work with RGBA16F buffers on iOS instead of fallback to RGBA8
This commit is contained in:
@@ -46,8 +46,10 @@ bool Texture2D::create(int width, int height, GLint internal_format, GLint forma
|
||||
glGenTextures(1, &m_tex);
|
||||
//LOG("TEX create %d", m_tex);
|
||||
bind();
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format,
|
||||
internal_format == GL_RGBA32F ? GL_FLOAT : GL_UNSIGNED_BYTE, data);
|
||||
auto ifmt = GL_UNSIGNED_BYTE;
|
||||
if (internal_format == GL_RGBA32F) ifmt = GL_FLOAT;
|
||||
if (internal_format == GL_RGBA16F) ifmt = GL_HALF_FLOAT;
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internal_format, width, height, 0, format, ifmt, data);
|
||||
unbind();
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user