mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-23 14:25:37 +00:00
GL/Texture: Use texture storage where available
This commit is contained in:
parent
95dba59826
commit
4fe1c07b02
|
@ -36,10 +36,16 @@ bool Texture::Create(u32 width, u32 height, u32 samples, GLenum internal_format,
|
|||
|
||||
if (samples > 1)
|
||||
{
|
||||
if (GLAD_GL_ARB_texture_storage || GLAD_GL_ES_VERSION_3_1)
|
||||
glTexStorage2DMultisample(target, samples, internal_format, width, height, GL_FALSE);
|
||||
else
|
||||
glTexImage2DMultisample(target, samples, internal_format, width, height, GL_FALSE);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GLAD_GL_ARB_texture_storage || GLAD_GL_ES_VERSION_3_0)
|
||||
glTexStorage2D(target, 1, internal_format, width, height);
|
||||
else
|
||||
glTexImage2D(target, 0, internal_format, width, height, 0, format, type, data);
|
||||
|
||||
glTexParameteri(target, GL_TEXTURE_MIN_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST);
|
||||
|
|
Loading…
Reference in a new issue