Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rgba as bgra_format_external on gles if bgra is not supported #3314

Merged
merged 1 commit into from Nov 16, 2018
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -1004,14 +1004,18 @@ impl Device {
}
} else {
// BGRA is not supported as an internal format, therefore we will
// use RGBA and swizzle during upload. Note that this is not
// supported on GLES.
// use RGBA. On non-gles we can swizzle during upload. This is not
// allowed on gles, so we must us RGBA for the external format too.
// Red and blue will appear reversed, but it is the best we can do.
// Since the internal format will actually be RGBA, if texture
// storage is supported we can use it for such textures.
assert_ne!(gl.get_type(), gl::GlType::Gles, "gles must have compatible internal and external formats");
(
gl::RGBA8,
gl::BGRA,
if gl.get_type() == gl::GlType::Gles {
gl::RGBA
} else {
gl::BGRA
},
if supports_texture_storage {
TexStorageUsage::Always
} else {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.