|
|
@ -184,6 +184,9 @@ GLint GetSwizzleSource(SwizzleSource source) { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void ApplyTextureDefaults(const SurfaceParams& params, GLuint texture) { |
|
|
void ApplyTextureDefaults(const SurfaceParams& params, GLuint texture) { |
|
|
|
|
|
if (params.IsBuffer()) { |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
glTextureParameteri(texture, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
|
|
glTextureParameteri(texture, GL_TEXTURE_MIN_FILTER, GL_LINEAR); |
|
|
glTextureParameteri(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
|
|
glTextureParameteri(texture, GL_TEXTURE_MAG_FILTER, GL_LINEAR); |
|
|
glTextureParameteri(texture, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
|
|
glTextureParameteri(texture, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); |
|
|
@ -208,6 +211,7 @@ OGLTexture CreateTexture(const SurfaceParams& params, GLenum target, GLenum inte |
|
|
glNamedBufferStorage(texture_buffer.handle, params.width * params.GetBytesPerPixel(), |
|
|
glNamedBufferStorage(texture_buffer.handle, params.width * params.GetBytesPerPixel(), |
|
|
nullptr, GL_DYNAMIC_STORAGE_BIT); |
|
|
nullptr, GL_DYNAMIC_STORAGE_BIT); |
|
|
glTextureBuffer(texture.handle, internal_format, texture_buffer.handle); |
|
|
glTextureBuffer(texture.handle, internal_format, texture_buffer.handle); |
|
|
|
|
|
break; |
|
|
case SurfaceTarget::Texture2D: |
|
|
case SurfaceTarget::Texture2D: |
|
|
case SurfaceTarget::TextureCubemap: |
|
|
case SurfaceTarget::TextureCubemap: |
|
|
glTextureStorage2D(texture.handle, params.emulated_levels, internal_format, params.width, |
|
|
glTextureStorage2D(texture.handle, params.emulated_levels, internal_format, params.width, |
|
|
|