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

Sync changes from mozilla-central gfx/wr #3865

Merged
merged 2 commits into from Feb 18, 2020
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Next

Bug 1615694. Declare our render targets up front to ANGLE. r=kvark

This should remove the allocation and copy in
TextureD3D::ensureRenderTarget() in some situations.

Differential Revision: https://phabricator.services.mozilla.com/D62952

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/106776ac6c2056323c24fbc1e57c9eaee537e64c
  • Loading branch information
jrmuizel authored and moz-gfx committed Feb 18, 2020
commit 2503a9f4ee36bcbcd00e9418fd5986f6db41b082

Some generated files are not rendered by default. Learn more.

@@ -7,7 +7,7 @@ edition = "2018"

[target.'cfg(windows)'.dependencies]
euclid = "0.20"
gleam = "0.6.2"
gleam = "0.9.2"
mozangle = {version = "0.3.1", features = ["egl"]}
webrender = {path = "../webrender"}
winapi = {version = "0.3", features = ["winerror", "d3d11", "dcomp"]}
@@ -7,7 +7,7 @@ license = "MPL-2.0"

[dependencies]
webrender = { path = "../../webrender" }
gleam = "0.6.2"
gleam = "0.9.2"

[target.'cfg(windows)'.dependencies]
compositor-windows = { path = "../compositor-windows" }
@@ -61,7 +61,7 @@ debug = ["webrender/capture", "webrender/debugger", "webrender/profiler"]
app_units = "0.7"
env_logger = "0.5"
euclid = "0.20"
gleam = "0.6.2"
gleam = "0.9.2"
glutin = "0.21"
rayon = "1"
webrender = { path = "../webrender" }
@@ -32,7 +32,7 @@ cfg-if = "0.1.2"
cstr = "0.1.2"
euclid = { version = "0.20.0", features = ["serde"] }
fxhash = "0.2.1"
gleam = "0.6.17"
gleam = "0.9.2"
image_loader = { optional = true, version = "0.22", package = "image", default-features = false, features = ["png_codec"] }
lazy_static = "1"
log = "0.4"
@@ -949,6 +949,8 @@ pub struct Capabilities {
/// Whether the driver supports uploading to textures from a non-zero
/// offset within a PBO.
pub supports_nonzero_pbo_offsets: bool,
/// Whether the driver supports specifying the texture usage up front.
pub supports_texture_usage: bool,
}

#[derive(Clone, Debug)]
@@ -1309,6 +1311,8 @@ impl Device {
gl.provoking_vertex_angle(gl::FIRST_VERTEX_CONVENTION);
}

let supports_texture_usage = supports_extension(&extensions, "GL_ANGLE_texture_usage");

// Our common-case image data in Firefox is BGRA, so we make an effort
// to use BGRA as the internal texture storage format to avoid the need
// to swizzle during upload. Currently we only do this on GLES (and thus
@@ -1480,6 +1484,7 @@ impl Device {
supports_khr_debug,
supports_texture_swizzle,
supports_nonzero_pbo_offsets,
supports_texture_usage,
},

color_formats,
@@ -2084,6 +2089,10 @@ impl Device {
self.bind_texture(DEFAULT_TEXTURE, &texture, Swizzle::default());
self.set_texture_parameters(texture.target, filter);

if self.capabilities.supports_texture_usage && render_target.is_some() {
self.gl.tex_parameter_i(texture.target, gl::TEXTURE_USAGE_ANGLE, gl::FRAMEBUFFER_ATTACHMENT_ANGLE as gl::GLint);
}

// Allocate storage.
let desc = self.gl_describe_format(texture.format);
let is_array = match texture.target {
@@ -12,7 +12,7 @@ bincode = "1.0"
byteorder = "1.0"
env_logger = { version = "0.5", optional = true }
euclid = "0.20"
gleam = "0.6.2"
gleam = "0.9.2"
glutin = "0.21"
app_units = "0.7"
clap = { version = "2", features = ["yaml"] }
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.