Skip to content

Fix 10/12 bits rendering on GLES3 (and core GL3+). #3121

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

Merged
merged 1 commit into from
Sep 26, 2018

Conversation

jyavenard
Copy link

@jyavenard jyavenard commented Sep 25, 2018

This change is Reviewable

@jyavenard
Copy link
Author

jyavenard commented Sep 25, 2018

For Windows to display those images properly you need to patch ANGLE

# Pastebin pI7R5f9w
diff --git a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp
index 2e3bcf7221cb5..508c4969467e6 100644
--- a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp
+++ b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/StreamProducerD3DTexture.cpp
@@ -59,6 +59,9 @@ egl::Error GetGLDescFromTex(ID3D11Texture2D *const tex,
         case DXGI_FORMAT_R8_UNORM:
             out->internalFormat = GL_R8;
             break;
+        case DXGI_FORMAT_R16_UNORM:
+            out->internalFormat = GL_R16_EXT;
+            break;
         case DXGI_FORMAT_R8G8_UNORM:
             out->internalFormat = GL_RG8;
             break;

@gw3583
Copy link
Contributor

gw3583 commented Sep 25, 2018

(We will hold off on merging this until we update gleam to handle the new format - https://searchfox.org/mozilla-central/source/third_party/rust/gleam/src/gl.rs#59).

@@ -2223,7 +2223,7 @@ impl Device {
pixel_type: gl::UNSIGNED_BYTE,
},
ImageFormat::R16 => FormatDesc {
internal: gl::RED as _,
internal: gl::R16 as _,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's fix the internal format of R8 as well since we are at it (hint: should be R8)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, I'll push another change for that.

@gw3583
Copy link
Contributor

gw3583 commented Sep 26, 2018

@bors-servo r+

@bors-servo
Copy link
Contributor

📌 Commit b662e68 has been approved by gw3583

@bors-servo
Copy link
Contributor

⌛ Testing commit b662e68 with merge 8ef886d...

bors-servo pushed a commit that referenced this pull request Sep 26, 2018
Fix 10/12 bits rendering on GLES3 (and core GL3+).

<!-- Reviewable:start -->
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/3121)
<!-- Reviewable:end -->
@gw3583
Copy link
Contributor

gw3583 commented Sep 26, 2018

@kvark Sorry, I r+'ed before seeing your comment!

@bors-servo
Copy link
Contributor

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: gw3583
Pushing 8ef886d to master...

@bors-servo bors-servo merged commit b662e68 into servo:master Sep 26, 2018
@jyavenard jyavenard deleted the 1493198_2 branch September 26, 2018 05:34
@jyavenard jyavenard restored the 1493198_2 branch September 26, 2018 16:25
@jyavenard jyavenard deleted the 1493198_2 branch September 26, 2018 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants