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 #4808

Merged
merged 5 commits into from
Apr 25, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Backed out 2 changesets (bug 1828248) for causing wrench bustages.
Backed out changeset 7a9431bded9e (bug 1828248)
Backed out changeset 5ec09fef9385 (bug 1828248)

[ghsync] From https://hg.mozilla.org/mozilla-central/rev/da1f855a8f692c34b823d04167575ffbfa0f91e7
  • Loading branch information
Sandor Molnar committed Apr 25, 2023
commit 38494e40adbad0054234ff8f708cfaafb88d30a7
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion example-compositor/compositor/Cargo.toml
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ license = "MPL-2.0"

[dependencies]
webrender = { path = "../../webrender" }
gleam = "0.15"
gleam = "0.13.1"

[target.'cfg(windows)'.dependencies]
compositor-windows = { path = "../compositor-windows" }
2 changes: 1 addition & 1 deletion examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ debug = ["webrender/capture", "webrender/profiler"]
app_units = "0.7"
env_logger = { version = "0.10", default_features = false }
euclid = "0.22"
gleam = "0.15"
gleam = "0.13"
glutin = "0.28"
rayon = "1"
webrender = { path = "../webrender" }
2 changes: 1 addition & 1 deletion swgl/Cargo.toml
Original file line number Diff line number Diff line change
@@ -12,4 +12,4 @@ glsl-to-cxx = { path = "../glsl-to-cxx" }
webrender_build = { path = "../webrender_build" }

[dependencies]
gleam = "0.15"
gleam = "0.13.1"
28 changes: 0 additions & 28 deletions swgl/src/swgl_fns.rs
Original file line number Diff line number Diff line change
@@ -964,10 +964,6 @@ impl Gl for Context {
}
}

fn bind_vertex_buffer(&self, binding_index: GLuint, buffer: GLuint, offset: GLintptr, stride: GLint) {
unimplemented!("Not supported by SWGL");
}

fn bind_texture(&self, target: GLenum, texture: GLuint) {
//panic!();
unsafe {
@@ -1409,10 +1405,6 @@ impl Gl for Context {
panic!();
}

fn vertex_attrib_binding(&self, attrib_index: GLuint, binding_index: GLuint) {
unimplemented!("Not supported by SWGL");
}

fn vertex_attrib_pointer_f32(
&self,
index: GLuint,
@@ -1477,18 +1469,6 @@ impl Gl for Context {
}
}

fn vertex_attrib_format(&self, attrib_index: GLuint, size: GLint, type_: GLenum, normalized: bool, relative_offset: GLuint) {
unimplemented!("Not supported by SWGL");
}

fn vertex_attrib_i_format(&self, attrib_index: GLuint, size: GLint, type_: GLenum, relative_offset: GLuint) {
unimplemented!("Not supported by SWGL");
}

fn vertex_binding_divisor(&self, binding_index: GLuint, divisor: GLuint) {
unimplemented!("Not supported by SWGL");
}

fn viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
debug!("viewport {} {} {} {}", x, y, width, height);
//panic!();
@@ -2305,14 +2285,6 @@ impl Gl for Context {
fn flush_mapped_buffer_range(&self, target: GLenum, offset: GLintptr, length: GLsizeiptr) {
unimplemented!("Not supported by SWGL");
}

fn start_tiling_qcom(&self, x: GLuint, y: GLuint, width: GLuint, height: GLuint, preserve_mask: GLbitfield) {
unimplemented!("Not supported by SWGL");
}

fn end_tiling_qcom(&self, preserve_mask: GLbitfield) {
unimplemented!("Not supported by SWGL");
}
}

/// A resource that is intended for sharing between threads.
2 changes: 1 addition & 1 deletion webrender/Cargo.toml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ bitflags = "1.2"
byteorder = "1.0"
euclid = { version = "0.22.0", features = ["serde"] }
fxhash = "0.2.1"
gleam = "0.15.0"
gleam = "0.13.1"
lazy_static = "1"
log = "0.4"
malloc_size_of_derive = "0.1"
5 changes: 0 additions & 5 deletions webrender/src/device/gl.rs
Original file line number Diff line number Diff line change
@@ -985,8 +985,6 @@ pub struct Capabilities {
pub supports_render_target_invalidate: bool,
/// Whether the driver can reliably upload data to R8 format textures.
pub supports_r8_texture_upload: bool,
/// Whether the extension QCOM_tiled_rendering is supported.
pub supports_qcom_tiled_rendering: bool,
/// Whether clip-masking is supported natively by the GL implementation
/// rather than emulated in shaders.
pub uses_native_clip_mask: bool,
@@ -1841,8 +1839,6 @@ impl Device {
true
};

let supports_qcom_tiled_rendering = supports_extension(&extensions, "GL_QCOM_tiled_rendering");

// On some Adreno 3xx devices the vertex array object must be unbound and rebound after
// an attached buffer has been orphaned.
let requires_vao_rebind_after_orphaning = is_adreno_3xx;
@@ -1880,7 +1876,6 @@ impl Device {
prefers_clear_scissor,
supports_render_target_invalidate,
supports_r8_texture_upload,
supports_qcom_tiled_rendering,
uses_native_clip_mask,
uses_native_antialiasing,
supports_image_external_essl3,
32 changes: 0 additions & 32 deletions webrender/src/renderer/mod.rs
Original file line number Diff line number Diff line change
@@ -2483,17 +2483,6 @@ impl Renderer {
{
let _timer = self.gpu_profiler.start_timer(GPU_TAG_SETUP_TARGET);
self.device.bind_draw_target(draw_target);

if self.device.get_capabilities().supports_qcom_tiled_rendering {
self.device.gl().start_tiling_qcom(
target.dirty_rect.min.x.max(0) as _,
target.dirty_rect.min.y.max(0) as _,
target.dirty_rect.width() as _,
target.dirty_rect.height() as _,
0,
);
}

self.device.enable_depth_write();
self.set_blend(false, framebuffer_kind);

@@ -2594,9 +2583,6 @@ impl Renderer {
}

self.device.invalidate_depth_target();
if self.device.get_capabilities().supports_qcom_tiled_rendering {
self.device.gl().end_tiling_qcom(gl::COLOR_BUFFER_BIT0_QCOM);
}
}

/// Draw an alpha batch container into a given draw target. This is used
@@ -3363,21 +3349,6 @@ impl Renderer {
{
let _timer = self.gpu_profiler.start_timer(GPU_TAG_SETUP_TARGET);
self.device.bind_draw_target(draw_target);

if self.device.get_capabilities().supports_qcom_tiled_rendering {
let preserve_mask = match target.clear_color {
Some(_) => 0,
None => gl::COLOR_BUFFER_BIT0_QCOM,
};
self.device.gl().start_tiling_qcom(
target.used_rect.min.x.max(0) as _,
target.used_rect.min.y.max(0) as _,
target.used_rect.width() as _,
target.used_rect.height() as _,
preserve_mask,
);
}

self.device.disable_depth();
self.set_blend(false, framebuffer_kind);

@@ -3508,9 +3479,6 @@ impl Renderer {
if clear_depth.is_some() {
self.device.invalidate_depth_target();
}
if self.device.get_capabilities().supports_qcom_tiled_rendering {
self.device.gl().end_tiling_qcom(gl::COLOR_BUFFER_BIT0_QCOM);
}
}

fn draw_blurs(
2 changes: 1 addition & 1 deletion wr_glyph_rasterizer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ serde = { optional = true, version = "1.0", features = ["serde_derive"] }
[dev-dependencies]
env_logger = { version = "0.10", default_features = false }
euclid = "0.22"
gleam = "0.15"
gleam = "0.13"
glutin = "0.28"
rayon = "1"
winit = "0.26"
2 changes: 1 addition & 1 deletion wrench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ path = "src/main.rs"
[dependencies]
base64 = "0.13"
env_logger = { version = "0.10", optional = true, default_features = false }
gleam = "0.15"
gleam = "0.13"
glutin = "0.28"
clap = { version = "3.1", features = ["yaml"] }
glsl-lang = { version = "0.2", features = ["lexer-v2-full"] }