diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:42 +0000 |
commit | da4c7e7ed675c3bf405668739c3012d140856109 (patch) | |
tree | cdd868dba063fecba609a1d819de271f0d51b23e /gfx/wr/webrender/src/command_buffer.rs | |
parent | Adding upstream version 125.0.3. (diff) | |
download | firefox-da4c7e7ed675c3bf405668739c3012d140856109.tar.xz firefox-da4c7e7ed675c3bf405668739c3012d140856109.zip |
Adding upstream version 126.0.upstream/126.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gfx/wr/webrender/src/command_buffer.rs')
-rw-r--r-- | gfx/wr/webrender/src/command_buffer.rs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gfx/wr/webrender/src/command_buffer.rs b/gfx/wr/webrender/src/command_buffer.rs index c0630db054..e630ceb628 100644 --- a/gfx/wr/webrender/src/command_buffer.rs +++ b/gfx/wr/webrender/src/command_buffer.rs @@ -3,6 +3,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ use api::units::PictureRect; +use crate::pattern::{PatternKind, PatternShaderInput}; use crate::{spatial_tree::SpatialNodeIndex, render_task_graph::RenderTaskId, surface::SurfaceTileDescriptor, picture::TileKey, renderer::GpuBufferAddress, FastHashMap, prim_store::PrimitiveInstanceIndex, gpu_cache::GpuCacheAddress}; use crate::gpu_types::{QuadSegment, TransformPaletteId}; use crate::segment::EdgeAaSegmentMask; @@ -115,6 +116,8 @@ pub enum PrimitiveCommand { gpu_buffer_address: GpuBufferAddress, }, Quad { + pattern: PatternKind, + pattern_input: PatternShaderInput, // TODO(gw): Used for bounding rect only, could possibly remove prim_instance_index: PrimitiveInstanceIndex, gpu_buffer_address: GpuBufferAddress, @@ -144,6 +147,8 @@ impl PrimitiveCommand { } pub fn quad( + pattern: PatternKind, + pattern_input: PatternShaderInput, prim_instance_index: PrimitiveInstanceIndex, gpu_buffer_address: GpuBufferAddress, transform_id: TransformPaletteId, @@ -151,6 +156,8 @@ impl PrimitiveCommand { edge_flags: EdgeAaSegmentMask, ) -> Self { PrimitiveCommand::Quad { + pattern, + pattern_input, prim_instance_index, gpu_buffer_address, transform_id, @@ -232,8 +239,11 @@ impl CommandBuffer { self.commands.push(Command::draw_instance(prim_instance_index)); self.commands.push(Command::data((gpu_buffer_address.u as u32) << 16 | gpu_buffer_address.v as u32)); } - PrimitiveCommand::Quad { prim_instance_index, gpu_buffer_address, transform_id, quad_flags, edge_flags } => { + PrimitiveCommand::Quad { pattern, pattern_input, prim_instance_index, gpu_buffer_address, transform_id, quad_flags, edge_flags } => { self.commands.push(Command::draw_quad(prim_instance_index)); + self.commands.push(Command::data(pattern as u32)); + self.commands.push(Command::data(pattern_input.0 as u32)); + self.commands.push(Command::data(pattern_input.1 as u32)); self.commands.push(Command::data((gpu_buffer_address.u as u32) << 16 | gpu_buffer_address.v as u32)); self.commands.push(Command::data(transform_id.0)); self.commands.push(Command::data((quad_flags.bits() as u32) << 16 | edge_flags.bits() as u32)); @@ -279,6 +289,11 @@ impl CommandBuffer { } Command::CMD_DRAW_QUAD => { let prim_instance_index = PrimitiveInstanceIndex(param); + let pattern = PatternKind::from_u32(cmd_iter.next().unwrap().0); + let pattern_input = PatternShaderInput( + cmd_iter.next().unwrap().0 as i32, + cmd_iter.next().unwrap().0 as i32, + ); let data = cmd_iter.next().unwrap(); let transform_id = TransformPaletteId(cmd_iter.next().unwrap().0); let bits = cmd_iter.next().unwrap().0; @@ -289,6 +304,8 @@ impl CommandBuffer { v: (data.0 & 0xffff) as u16, }; let cmd = PrimitiveCommand::quad( + pattern, + pattern_input, prim_instance_index, gpu_buffer_address, transform_id, |