vulkan: split renderer operations
This commit is contained in:
parent
959f23f61b
commit
ed0dc3fbad
2 changed files with 97 additions and 83 deletions
|
|
@ -1,8 +1,13 @@
|
|||
mod color;
|
||||
mod op;
|
||||
mod paint_region;
|
||||
|
||||
use {
|
||||
color::{ColorTransforms, EotfArgsCache},
|
||||
op::{
|
||||
TexCopyType, TexSourceType, VulkanFillOp, VulkanOp, VulkanRoundedFillOp,
|
||||
VulkanRoundedTexOp, VulkanTexOp,
|
||||
},
|
||||
paint_region::{PaintRegion, Point, constrain_to_fb},
|
||||
crate::{
|
||||
async_engine::{AsyncEngine, SpawnedFuture},
|
||||
|
|
@ -77,9 +82,7 @@ use {
|
|||
borrow::Cow,
|
||||
cell::{Cell, LazyCell, RefCell},
|
||||
fmt::{Debug, Formatter},
|
||||
mem,
|
||||
ops::Range,
|
||||
ptr,
|
||||
mem, ptr,
|
||||
rc::{Rc, Weak},
|
||||
slice,
|
||||
},
|
||||
|
|
@ -160,18 +163,6 @@ pub(super) struct UsedTexture {
|
|||
release_sync: ReleaseSync,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Linearize)]
|
||||
pub(super) enum TexCopyType {
|
||||
Identity,
|
||||
Multiply,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Linearize)]
|
||||
pub(super) enum TexSourceType {
|
||||
Opaque,
|
||||
HasAlpha,
|
||||
}
|
||||
|
||||
#[derive(Default)]
|
||||
pub(super) struct Memory {
|
||||
dmabuf_sample: Vec<Rc<VulkanImage>>,
|
||||
|
|
@ -210,74 +201,6 @@ pub(super) struct Memory {
|
|||
fb_inv_eotf_args_address: Option<DeviceSize>,
|
||||
}
|
||||
|
||||
enum VulkanOp {
|
||||
Fill(VulkanFillOp),
|
||||
Tex(VulkanTexOp),
|
||||
RoundedFill(VulkanRoundedFillOp),
|
||||
RoundedTex(VulkanRoundedTexOp),
|
||||
}
|
||||
|
||||
struct VulkanTexOp {
|
||||
tex: Rc<VulkanImage>,
|
||||
index: usize,
|
||||
range: Range<usize>,
|
||||
buffer_resv: Option<Rc<dyn BufferResv>>,
|
||||
acquire_sync: Option<AcquireSync>,
|
||||
release_sync: ReleaseSync,
|
||||
alpha: f32,
|
||||
source_type: TexSourceType,
|
||||
copy_type: TexCopyType,
|
||||
alpha_mode: AlphaMode,
|
||||
range_address: DeviceAddress,
|
||||
instances: u32,
|
||||
tex_cd: Rc<ColorDescription>,
|
||||
color_management_data_address: Option<DeviceAddress>,
|
||||
eotf_args_address: Option<DeviceAddress>,
|
||||
resource_descriptor_buffer_offset: DeviceAddress,
|
||||
}
|
||||
|
||||
struct VulkanFillOp {
|
||||
range: Range<usize>,
|
||||
color: [f32; 4],
|
||||
source_type: TexSourceType,
|
||||
range_address: DeviceAddress,
|
||||
instances: u32,
|
||||
}
|
||||
|
||||
struct VulkanRoundedFillOp {
|
||||
target: Point,
|
||||
color: [f32; 4],
|
||||
source_type: TexSourceType,
|
||||
size: [f32; 2],
|
||||
corner_radius: [f32; 4],
|
||||
border_width: f32,
|
||||
scale: f32,
|
||||
range_address: DeviceAddress,
|
||||
z_order: u32,
|
||||
}
|
||||
|
||||
struct VulkanRoundedTexOp {
|
||||
tex: Rc<VulkanImage>,
|
||||
index: usize,
|
||||
target: Point,
|
||||
source: Point,
|
||||
buffer_resv: Option<Rc<dyn BufferResv>>,
|
||||
acquire_sync: Option<AcquireSync>,
|
||||
release_sync: ReleaseSync,
|
||||
alpha: f32,
|
||||
source_type: TexSourceType,
|
||||
copy_type: TexCopyType,
|
||||
alpha_mode: AlphaMode,
|
||||
tex_cd: Rc<ColorDescription>,
|
||||
color_management_data_address: Option<DeviceAddress>,
|
||||
eotf_args_address: Option<DeviceAddress>,
|
||||
resource_descriptor_buffer_offset: DeviceAddress,
|
||||
size: [f32; 2],
|
||||
corner_radius: [f32; 4],
|
||||
scale: f32,
|
||||
range_address: DeviceAddress,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Linearize, Eq, PartialEq)]
|
||||
pub(super) enum RenderPass {
|
||||
BlendBuffer,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue