RUNTIME 2309: a texture whose rows are in place makes its shadow at the first reach of its image
A device-gap texture over a buffer (its image refused for a reason that leaves its rows in place: format, pitch, placement, source, dma-buf) was a shadow made at new_texture: its VkImage, memory and views, its notice and shadow-log line, and its slot in the texture table and every heap set. A slot whose function only reads, writes or asks its size binds the rows in place, so a texture only ever bound that way paid for a shadow no command used (reims's gbs91 on the 780M: hundreds of such textures, 8 to 52 MB each). Now such a texture (rows in place, no pending in-place verdict, not over a heap's buffer) is made with its shadow left unmade (texture/lazy_shadow.rs): the storage accessor makes it at the first reach, once, under a lock, with the making's notice, log line and counts, then places its slot (its resource ID reads the neutral until then). Paths that must not make it read the recipe instead (rows binding, placement and heap-set writes, CPU copies, blits on the bytes, shape and plan questions, logging). The reaches that make it: a slot that binds the image (before the command's copies are planned from its uses), use_resource, a pass's attachment, an execution of commands inheriting the bindings, a view, its VkImage handed out. An out-of-memory making fails the reaching call, as new_texture did. WorkCounts::shadows_left_unmade and shadows_made_at_use count both halves; docs/API.md says when the shadowed-texture notice is given. Not in scope: two kinds still make their shadow at new_texture. A texture waiting on its pages' in-place verdict may move in place. A texture over a heap's buffer is made resident by use_heap through a path that checks the shadow. RUNTIME_VERSION moves because the run's announcements change. The shadowed-texture notice and the shadow-log line come at the making, and a texture only ever bound through its rows gives neither. A resource-ID read of an unmade texture gets the neutral. No new Degradation kind. No FAST-PATHS row: the copy work follows uses, not the shadow's existence (an unbound shadow was copied 0 times per commit before and after), so no accuracy is traded. The saving is the making: the VkImage, its memory, views and heap-set slots. Test: tests::texel_rows_device::a_shadow_is_made_at_the_first_reach_of_its_image, on a copied buffer, since over the pages lavapipe lays the rows in place. Three cases: - a written-only texture: shadows_left_unmade +1, none made, shadowed_textures 0, shadow_copies 0, texels inverted in the pages; - a rows write then a sample in one command buffer: made at the sample, copies > 0, pixels equal to a device-own texture's; - use_resource: made at the call. joined_residency's helper asserts shadows_bytes() where it asserted the shadow at new_texture. Verified, msi m3-max-30024 at 088a73d3b7: - clippy -D warnings, runtime crate, all targets and features: plain and --cfg m2v_cpu_icd exit 0; - lavapipe 206/206: texel_rows, shadow*, read_twin*, joined_residency, padding/kept_padding, exported_*, first_host_texture, surface_shapes, attached_read*, copied_device, fresh_pages, texture::*; - translator api_signatures, api_surface and fast_paths: 47/47; - the negative control in the same job (lazy = false): the test fails at "Copy: left unmade", (0,0,1) against (1,0,0).
This commit is contained in:
1 parent
9972bec765
commit
e453efbf0a
31 files changed
+1004
-330
No files matched your search
@@ -3363,6 +3363,10 @@ fn other_use(
|
||||
let write = access(write, resource.access.write);
|
||||
return texture.rows_use(read, write).map(Some);
|
||||
}
|
||||
// Any other slot binds the texture's image: a shadow left unmade is made here,
|
||||
// before the command's copies are planned from its uses
|
||||
// (`texture/lazy_shadow.rs`).
|
||||
texture.made_for_use()?;
|
||||
let (read, write) = image_access(resource.class)?;
|
||||
let storage = resource.class == AccessClass::StorageImage;
|
||||
let accesses = (
|
||||
|
||||
@@ -2213,7 +2213,7 @@ impl BlitCommandEncoder {
|
||||
// of that format over the same levels: the same bits, filtered alike (a filter
|
||||
// takes each channel alone, and `metal::format::swizzle_over` pairs formats of the
|
||||
// same channels).
|
||||
match texture.bound_twin() {
|
||||
match texture.bound_twin()? {
|
||||
Some(twin) => this.mipmaps(&twin),
|
||||
None => this.mipmaps(texture),
|
||||
}
|
||||
|
||||
@@ -1285,6 +1285,13 @@ impl ComputeCommandEncoder {
|
||||
self.core.fail_memoryless_use();
|
||||
return Ok(());
|
||||
}
|
||||
// A texture's shadow left unmade is made as the encoder makes it resident: its resource
|
||||
// ID reads it from then on (`texture/lazy_shadow.rs`).
|
||||
for resource in resources {
|
||||
if let ResourceRef::Texture(texture) = resource {
|
||||
texture.made_for_use()?;
|
||||
}
|
||||
}
|
||||
for &resource in resources {
|
||||
// Its records held where they lie in device-local memory, before any listing of
|
||||
// them reads where they lie (`indirect_command_buffer/home.rs`).
|
||||
|
||||
@@ -604,6 +604,11 @@ impl DeviceHeaps {
|
||||
};
|
||||
// The holder may be a texture's last handle: it goes once the lock is free.
|
||||
held.push(texture.clone());
|
||||
// A shadow left unmade holds the neutral's entry until it is made, which places it
|
||||
// (`texture/lazy_shadow.rs`).
|
||||
if texture.shadow_unmade() {
|
||||
return self.clear(device, id);
|
||||
}
|
||||
let facts = texture.facts();
|
||||
let flags = handle_entry_flags(&facts);
|
||||
let bytes = texture.bytes_key();
|
||||
|
||||
@@ -202,7 +202,7 @@ impl Texture {
|
||||
/// call answers the new one's.
|
||||
pub unsafe fn vk_image(&self) -> Option<vk::Image> {
|
||||
let _held = self.hold();
|
||||
if self.shadow().is_some() {
|
||||
if self.shadows_bytes() {
|
||||
return None;
|
||||
}
|
||||
self.exported_image().ok()
|
||||
|
||||
@@ -95,6 +95,13 @@ impl RenderLowering {
|
||||
self.core.fail_memoryless_use();
|
||||
return Ok(());
|
||||
}
|
||||
// A texture's shadow left unmade is made as the encoder makes it resident: its resource
|
||||
// ID reads it from then on (`texture/lazy_shadow.rs`).
|
||||
for resource in resources {
|
||||
if let ResourceRef::Texture(texture) = resource {
|
||||
texture.made_for_use()?;
|
||||
}
|
||||
}
|
||||
for &resource in resources {
|
||||
// Its records held where they lie in device-local memory, before any listing of
|
||||
// them reads where they lie (`indirect_command_buffer/home.rs`).
|
||||
|
||||
@@ -744,6 +744,8 @@ impl RenderLowering {
|
||||
.map(|texture| (texture, true));
|
||||
let mut shadows = Vec::new();
|
||||
for (texture, writes) in tables.chain(snapshot.residency.textures_written()) {
|
||||
// A shadow left unmade is made here: a command may bind it (`texture/lazy_shadow.rs`).
|
||||
texture.made_for_use()?;
|
||||
if let Some(copies) = texture.shadow() {
|
||||
let used = ShadowUse {
|
||||
copies: Arc::clone(copies),
|
||||
|
||||
@@ -1940,6 +1940,8 @@ fn target(
|
||||
true => texture.ycbcr_render_shadow(call)?,
|
||||
false => texture.pass_texture()?,
|
||||
};
|
||||
// A shadow left unmade is made as the pass's attachment (`texture/lazy_shadow.rs`).
|
||||
texture.made_for_use()?;
|
||||
let plan = texture.image_plan()?;
|
||||
// A 3D attachment is a 2D view of its planes, which its image takes 2D-array compatible
|
||||
// (`image_plan.rs`): a device whose portability subset withholds `imageView2DOn3DImage` makes
|
||||
|
||||
@@ -87,7 +87,9 @@ fn shadowed(device: &Device) -> (Buffer, Texture) {
|
||||
descriptor.usage = TextureUsage::SHADER_READ;
|
||||
descriptor.resource_options = buffer.resource_options();
|
||||
let texture = buffer.new_texture(&descriptor, 0, 352).unwrap();
|
||||
assert!(texture.shadow().is_some(), "the device took no shadow");
|
||||
// A shadow whose rows are in place is made as a residency makes it resident
|
||||
// (`texture/lazy_shadow.rs`).
|
||||
assert!(texture.shadows_bytes(), "the device took no shadow");
|
||||
(buffer, texture)
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,12 @@
|
||||
//! - **The shadow still serves a sample.** A kernel that samples the texture after the rows'
|
||||
//! writes, in the same command buffer and in the next, reads the inverted texels through the
|
||||
//! shadow, copied in.
|
||||
//! - **Its shadow made at use.** The texture is made with its shadow left unmade
|
||||
//! (`texture/lazy_shadow.rs`): one only written through its rows makes none and copies nothing;
|
||||
//! the first kernel that samples one makes it at its binding, copied in after an earlier
|
||||
//! encoder's writes of the rows in the same command buffer, and reads what a texture of the
|
||||
//! device's own holding the texels gives; a `use_resource` of one makes it at the call
|
||||
//! (`WorkCounts::shadows_left_unmade`, `shadows_made_at_use`, `shadowed_textures`).
|
||||
//! - **The image route's answers.** The rows read and write what the image route does, bit for
|
||||
//! bit: every `RGBA8Unorm` code read, and a sweep of floats written (each code's value, the
|
||||
//! midpoints between codes, and values outside `[0, 1]`); every `RGBA16Float` code read, and
|
||||
@@ -29,7 +35,7 @@ use crate::{
|
||||
Buffer, CommandBufferStatus, ComputePipelineState, Device, DeviceKind, DeviceOptions,
|
||||
HostMemory, ImportGate, Region, ResourceOptions, Size, Texture, TextureDescriptor, WorkCounts,
|
||||
};
|
||||
use metal2vulkan::metal::{PixelFormat, TextureUsage};
|
||||
use metal2vulkan::metal::{PixelFormat, ResourceUsage, TextureUsage};
|
||||
use std::alloc::Layout;
|
||||
use std::ptr::NonNull;
|
||||
use std::sync::Arc;
|
||||
@@ -415,6 +421,154 @@ fn reads_and_writes(device: &Device, over: Over) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
/// A dispatch of `invert` (`rows_invert`) over `texture`'s texels.
|
||||
fn inverting<'a>(invert: &'a ComputePipelineState, texture: &'a Texture) -> Dispatch<'a> {
|
||||
Dispatch {
|
||||
state: invert,
|
||||
texture,
|
||||
buffer: None,
|
||||
grid: [SIDE, SIDE],
|
||||
}
|
||||
}
|
||||
|
||||
/// Shadows left unmade, made at use, and made in all, from `before` to `after`.
|
||||
fn unmade_made(before: &WorkCounts, after: &WorkCounts) -> (u64, u64, u64) {
|
||||
(
|
||||
after.shadows_left_unmade - before.shadows_left_unmade,
|
||||
after.shadows_made_at_use - before.shadows_made_at_use,
|
||||
after.shadowed_textures - before.shadowed_textures,
|
||||
)
|
||||
}
|
||||
|
||||
/// A texture whose rows are in place is made with its shadow left unmade: a kernel that only
|
||||
/// writes it through its rows makes none and copies nothing; the first kernel that samples one
|
||||
/// makes the shadow at its binding, its copy in after an earlier encoder's writes of the rows in
|
||||
/// the same command buffer, and reads what a texture of the device's own holding those texels
|
||||
/// gives; a `use_resource` of one makes its shadow at the call.
|
||||
#[test]
|
||||
fn a_shadow_is_made_at_the_first_reach_of_its_image() {
|
||||
let Some(device) = device() else { return };
|
||||
let taken: Vec<Over> = (OVER.into_iter())
|
||||
.filter(|&over| made_at_use(&device, over))
|
||||
.collect();
|
||||
if untaken_passes(&taken) {
|
||||
eprintln!("TEXEL-ROWS: this device lays the rows in place; nothing to test");
|
||||
}
|
||||
}
|
||||
|
||||
/// [`a_shadow_is_made_at_the_first_reach_of_its_image`] over a buffer lying as `over` says;
|
||||
/// `false` where the texture's rows are not read in place.
|
||||
fn made_at_use(device: &Device, over: Over) -> bool {
|
||||
let pitch = SIDE * 4 + 16;
|
||||
let pages = Pages::new((pitch * SIDE) as usize, 11);
|
||||
let buffer = pages.buffer(device, over);
|
||||
let shape = (PixelFormat::BGRA8Unorm, SIDE, SIDE);
|
||||
let invert = state(device, "rows_invert");
|
||||
let sample = state(device, "rows_sample");
|
||||
let original = pages.bytes();
|
||||
let layout = (SIDE, SIDE, 4, pitch);
|
||||
let inverted: Vec<u8> = (tight(&original, layout).as_chunks::<4>().0.iter())
|
||||
.flat_map(|t| [255 - t[0], 255 - t[1], 255 - t[2], t[3]])
|
||||
.collect();
|
||||
// Written through its rows alone: no shadow made, nothing copied, the texels inverted in the
|
||||
// pages; dropped unmade.
|
||||
let before = device.work_counts();
|
||||
let (written, rows) = texture_over(device, (&buffer, over), shape, pitch);
|
||||
if !rows {
|
||||
return false;
|
||||
}
|
||||
let made = device.work_counts();
|
||||
assert_eq!(
|
||||
unmade_made(&before, &made),
|
||||
(1, 0, 0),
|
||||
"{over:?}: left unmade"
|
||||
);
|
||||
assert!(written.shadow().is_none(), "{over:?}: no shadow");
|
||||
let status = run(device, &[inverting(&invert, &written)]);
|
||||
let after = device.work_counts();
|
||||
assert_eq!(status, CommandBufferStatus::Completed);
|
||||
assert_eq!(
|
||||
unmade_made(&made, &after),
|
||||
(0, 0, 0),
|
||||
"{over:?}: written, none made"
|
||||
);
|
||||
assert_eq!(shadow_copies(&made, &after), 0, "{over:?}: nothing copied");
|
||||
assert!(written.shadow().is_none(), "{over:?}: still no shadow");
|
||||
assert!(
|
||||
tight(&pages.bytes(), layout) == inverted,
|
||||
"{over:?}: the texels inverted in the pages"
|
||||
);
|
||||
drop(written);
|
||||
// Inverted back through its rows, then sampled, in one command buffer: the sample's binding
|
||||
// makes the shadow, whose copy in follows the first encoder's writes.
|
||||
let before = device.work_counts();
|
||||
let (sampled, _) = texture_over(device, (&buffer, over), shape, pitch);
|
||||
let out = device
|
||||
.new_buffer(SIDE * SIDE * 16, ResourceOptions::shared())
|
||||
.unwrap();
|
||||
let made = device.work_counts();
|
||||
assert_eq!(
|
||||
unmade_made(&before, &made),
|
||||
(1, 0, 0),
|
||||
"{over:?}: left unmade"
|
||||
);
|
||||
let read = Dispatch {
|
||||
state: &sample,
|
||||
texture: &sampled,
|
||||
buffer: Some(&out),
|
||||
grid: [SIDE, SIDE],
|
||||
};
|
||||
let status = run(device, &[inverting(&invert, &sampled), read]);
|
||||
let after = device.work_counts();
|
||||
assert_eq!(status, CommandBufferStatus::Completed);
|
||||
assert_eq!(
|
||||
unmade_made(&made, &after),
|
||||
(0, 1, 1),
|
||||
"{over:?}: made at the sample"
|
||||
);
|
||||
assert!(shadow_copies(&made, &after) > 0, "{over:?}: copied in");
|
||||
assert!(sampled.shadow().is_some(), "{over:?}: a shadow now");
|
||||
let answer = contents(&out, (SIDE * SIDE * 16) as usize);
|
||||
let want = sampled_from(
|
||||
device,
|
||||
&sample,
|
||||
&own_texture(device, shape, 4, &tight(&original, layout)),
|
||||
);
|
||||
let stale = sampled_from(device, &sample, &own_texture(device, shape, 4, &inverted));
|
||||
assert_eq!(
|
||||
first_difference(&answer, &want, 16),
|
||||
None,
|
||||
"{over:?}: the sample reads the rows' writes (what the pages held before them: {})",
|
||||
first_difference(&answer, &stale, 16).is_none()
|
||||
);
|
||||
// A `use_resource` makes it at the call.
|
||||
let before = device.work_counts();
|
||||
let (used, _) = texture_over(device, (&buffer, over), shape, pitch);
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let command_buffer = queue.command_buffer().unwrap();
|
||||
let mut encoder = command_buffer.compute_command_encoder().unwrap();
|
||||
let made = device.work_counts();
|
||||
(encoder.use_resource(used.as_resource(), ResourceUsage::READ)).unwrap();
|
||||
let after = device.work_counts();
|
||||
assert_eq!(
|
||||
unmade_made(&before, &made),
|
||||
(1, 0, 0),
|
||||
"{over:?}: left unmade"
|
||||
);
|
||||
assert_eq!(
|
||||
unmade_made(&made, &after),
|
||||
(0, 1, 1),
|
||||
"{over:?}: made at use_resource"
|
||||
);
|
||||
assert!(used.shadow().is_some(), "{over:?}: a shadow now");
|
||||
encoder.end_encoding().unwrap();
|
||||
command_buffer.commit().unwrap();
|
||||
command_buffer.wait_until_completed_for(WAIT).unwrap();
|
||||
assert_eq!(command_buffer.status(), CommandBufferStatus::Completed);
|
||||
drop((sampled, used, buffer));
|
||||
true
|
||||
}
|
||||
|
||||
/// What `sample` (`rows_sample`) answers for each texel of `texture`, one command buffer of its
|
||||
/// own.
|
||||
fn sampled_from(device: &Device, sample: &ComputePipelineState, texture: &Texture) -> Vec<u8> {
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -191,7 +191,7 @@
|
||||
//! ranges: a copy or a snapshot is another resource) announces it,
|
||||
//! `Degradation::AttachmentReadInPlace`.
|
||||
|
||||
use super::{Device, Owner, Storage, Texture};
|
||||
use super::{Device, Owner, Storage, Stored, Texture};
|
||||
use crate::binding_view::{binding_view, VkView};
|
||||
use crate::command_buffer::CommandBuffer;
|
||||
use crate::error::Error;
|
||||
@@ -444,7 +444,7 @@ impl Texture {
|
||||
/// attached one in place of its copy (`render/attached_levels.rs`): its storage is an image of
|
||||
/// its own, not a sparse one, with no decoded twin, whose image has the sampled usage.
|
||||
pub(crate) fn reads_levels_in_place(&self) -> bool {
|
||||
let Storage::Image(image) = self.storage() else {
|
||||
let Stored::Made(Storage::Image(image)) = self.stored() else {
|
||||
return false;
|
||||
};
|
||||
!matches!(image.owner, Owner::Sparse(_))
|
||||
@@ -499,7 +499,9 @@ impl Texture {
|
||||
colors: &'s AttachedColors,
|
||||
keep: impl Fn(&AttachedColor) -> bool + 's,
|
||||
) -> impl Iterator<Item = (usize, u32)> + 's {
|
||||
let image = self.image().ok();
|
||||
// A shadow left unmade is no attachment's: a pass's attachment makes it
|
||||
// (`texture/lazy_shadow.rs`).
|
||||
let image = self.made_image();
|
||||
let record = &self.0.record;
|
||||
let levels = record.base_level..record.base_level + record.level_count;
|
||||
let layers = record.base_layer..record.base_layer + record.layer_count;
|
||||
@@ -549,9 +551,11 @@ impl Texture {
|
||||
/// place at its first level and slice, where the image has `usage` and the texture is of the
|
||||
/// kinds [`snapshot_color`](Self::snapshot_color) names.
|
||||
fn own_color(&self, layout: &PassLayout, usage: ImageUsageFlags) -> Option<usize> {
|
||||
let image = match self.storage() {
|
||||
Storage::Image(image) | Storage::Shadow { image, .. } => image,
|
||||
Storage::Alias { image, .. } if self.image_over_buffer() => image,
|
||||
// A shadow left unmade renders nowhere: a pass's attachment makes it
|
||||
// (`texture/lazy_shadow.rs`).
|
||||
let image = match self.stored() {
|
||||
Stored::Made(Storage::Image(image) | Storage::Shadow { image, .. }) => image,
|
||||
Stored::Made(Storage::Alias { image, .. }) if self.image_over_buffer() => image,
|
||||
_ => return None,
|
||||
};
|
||||
let plan = image.plan();
|
||||
|
||||
@@ -33,7 +33,7 @@ use super::super::device::lock;
|
||||
use super::super::error::Error;
|
||||
use super::super::values::StorageMode;
|
||||
use super::super::PurgeableState;
|
||||
use super::{Image, Owner, Storage, Texture};
|
||||
use super::{Image, Owner, Storage, Stored, Texture};
|
||||
use metal2vulkan::vk::ImageType;
|
||||
use std::sync::Mutex;
|
||||
|
||||
@@ -101,9 +101,12 @@ impl Texture {
|
||||
// A texture with two faces keeps its state with its own image, whichever face it
|
||||
// presents (`texture/faces.rs`).
|
||||
let parts = self.s();
|
||||
let storage = match parts.faces.get() {
|
||||
Some(_) => &parts.storage,
|
||||
None => self.storage(),
|
||||
let storage = match (parts.faces.get(), self.stored()) {
|
||||
(Some(_), _) => parts.storage.made()?,
|
||||
(None, Stored::Made(storage)) => storage,
|
||||
// A shadow left unmade (`texture/lazy_shadow.rs`), Metal's `NonVolatile` as a
|
||||
// shadow's.
|
||||
(None, Stored::Unmade(_)) => return None,
|
||||
};
|
||||
match storage {
|
||||
Storage::Image(image) => match &image.owner {
|
||||
|
||||
@@ -47,7 +47,7 @@ use super::super::values::StorageMode;
|
||||
use super::super::view_plan::ViewRequest;
|
||||
use super::super::ycbcr::IoSurfaceYCbCr;
|
||||
use super::super::Device;
|
||||
use super::{IdUse, Initial, Owner, Storage, Texture, TextureShared};
|
||||
use super::{IdUse, Initial, Owner, Storage, Stored, Texture, TextureShared};
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::{Arc, Weak};
|
||||
|
||||
@@ -359,8 +359,8 @@ impl Texture {
|
||||
/// The buffer the texels of the texture, a texture buffer of `Device::new_texture`, lie in,
|
||||
/// where the recovery carried it to `to`; `None` for any other texture, or where it left it.
|
||||
fn texels_carried_to(&self, to: &Device) -> Option<Buffer> {
|
||||
match self.storage() {
|
||||
Storage::Texels(texels)
|
||||
match self.stored() {
|
||||
Stored::Made(Storage::Texels(texels))
|
||||
if texels.home == TexelsHome::Buffer && texels.buffer.generation().same(to) =>
|
||||
{
|
||||
Some(texels.buffer.clone())
|
||||
@@ -374,26 +374,35 @@ impl Texture {
|
||||
if self.root().0.heap.is_some() {
|
||||
return TextureLeft::Heap;
|
||||
}
|
||||
match self.storage() {
|
||||
Storage::Image(image) => match &image.owner {
|
||||
Owner::Heap(_) | Owner::HeapShadow(_) | Owner::HeapUnaliased(_) => {
|
||||
TextureLeft::Heap
|
||||
let texels = match self.stored() {
|
||||
Stored::Made(Storage::Image(image)) => {
|
||||
return match &image.owner {
|
||||
Owner::Heap(_) | Owner::HeapShadow(_) | Owner::HeapUnaliased(_) => {
|
||||
TextureLeft::Heap
|
||||
}
|
||||
Owner::Caller(_) => TextureLeft::Caller,
|
||||
Owner::Sparse(_) => TextureLeft::Sparse,
|
||||
Owner::Runtime {
|
||||
shareable: true, ..
|
||||
} => TextureLeft::Shared,
|
||||
Owner::Buffer { .. } => TextureLeft::Buffer,
|
||||
Owner::Runtime { .. } | Owner::ViewShadow(_) => TextureLeft::Other,
|
||||
}
|
||||
Owner::Caller(_) => TextureLeft::Caller,
|
||||
Owner::Sparse(_) => TextureLeft::Sparse,
|
||||
Owner::Runtime {
|
||||
shareable: true, ..
|
||||
} => TextureLeft::Shared,
|
||||
Owner::Buffer { .. } => TextureLeft::Buffer,
|
||||
Owner::Runtime { .. } | Owner::ViewShadow(_) => TextureLeft::Other,
|
||||
},
|
||||
Storage::Texels(texels) if texels.home == TexelsHome::Shared => TextureLeft::Shared,
|
||||
Storage::Texels(texels)
|
||||
| Storage::Alias { texels, .. }
|
||||
| Storage::Shadow { texels, .. } => match texels.buffer.heap() {
|
||||
Some(_) => TextureLeft::Heap,
|
||||
None => TextureLeft::Buffer,
|
||||
},
|
||||
}
|
||||
Stored::Made(Storage::Texels(texels)) if texels.home == TexelsHome::Shared => {
|
||||
return TextureLeft::Shared
|
||||
}
|
||||
Stored::Made(
|
||||
Storage::Texels(texels)
|
||||
| Storage::Alias { texels, .. }
|
||||
| Storage::Shadow { texels, .. },
|
||||
) => texels,
|
||||
// A shadow left unmade is over its bytes (`texture/lazy_shadow.rs`).
|
||||
Stored::Unmade(recipe) => &recipe.texels,
|
||||
};
|
||||
match texels.buffer.heap() {
|
||||
Some(_) => TextureLeft::Heap,
|
||||
None => TextureLeft::Buffer,
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -44,7 +44,7 @@
|
||||
use super::super::device::lock;
|
||||
use super::super::texture_descriptor::TextureDescriptor;
|
||||
use super::super::Device;
|
||||
use super::{ImageMaker, ImagePlan, Owner, Storage, Texture};
|
||||
use super::{ImageMaker, ImagePlan, Owner, Storage, Stored, Texture};
|
||||
use metal2vulkan::vk::ImageUsageFlags;
|
||||
use std::sync::Mutex;
|
||||
|
||||
@@ -78,8 +78,8 @@ fn covers(have: &ImageKey, want: &ImageKey) -> bool {
|
||||
/// The bytes of memory of `texture`'s image, where the runtime placed it in memory of its own; 0
|
||||
/// for any other.
|
||||
fn image_bytes(texture: &Texture) -> u64 {
|
||||
match texture.storage() {
|
||||
Storage::Image(image) => match &image.owner {
|
||||
match texture.stored() {
|
||||
Stored::Made(Storage::Image(image)) => match &image.owner {
|
||||
Owner::Runtime { placement, .. } => placement.size(),
|
||||
_ => 0,
|
||||
},
|
||||
|
||||
@@ -272,7 +272,7 @@ impl Texture {
|
||||
/// its usage made it a shadow of its own before an attached read could.
|
||||
pub(super) fn faces_fit(&self) -> bool {
|
||||
let (shared, parts) = (&self.0, self.s());
|
||||
let Storage::Image(image) = &parts.storage else {
|
||||
let Some(Storage::Image(image)) = parts.storage.made() else {
|
||||
return false;
|
||||
};
|
||||
let own = matches!(
|
||||
@@ -335,7 +335,7 @@ impl Texture {
|
||||
/// the two. The attached reads' shadow while the texture presents its own image.
|
||||
pub(super) fn make_faces(&self) -> Result<Arc<UsageShadow>, Error> {
|
||||
let parts = self.s();
|
||||
let Storage::Image(own) = &parts.storage else {
|
||||
let Some(Storage::Image(own)) = parts.storage.made() else {
|
||||
return Err(crate::error::internal(
|
||||
"faces of a texture without an image",
|
||||
));
|
||||
@@ -434,11 +434,11 @@ impl Texture {
|
||||
let to = 1 - from;
|
||||
let image = |face: usize| -> Arc<Image> {
|
||||
let storage = match face {
|
||||
0 => &parts.storage,
|
||||
_ => &faces.other,
|
||||
0 => parts.storage.made(),
|
||||
_ => Some(&faces.other),
|
||||
};
|
||||
match storage {
|
||||
Storage::Image(image) => Arc::clone(image),
|
||||
Some(Storage::Image(image)) => Arc::clone(image),
|
||||
_ => unreachable!("a face is an image"),
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
//! so and checks nothing.
|
||||
|
||||
use super::first_move::Fresh;
|
||||
use super::{Image, Owner, Storage, Texture};
|
||||
use super::{Image, Owner, Storage, Stored, Texture};
|
||||
use crate::buffer::MemoryHold;
|
||||
use crate::device::lock;
|
||||
use crate::{
|
||||
@@ -115,9 +115,9 @@ fn texels() -> Vec<u8> {
|
||||
|
||||
/// The image `texture`'s storage holds, as an alias of a buffer's bytes or as its own.
|
||||
fn image_of(texture: &Texture) -> Option<&Arc<Image>> {
|
||||
match texture.storage() {
|
||||
Storage::Alias { image, .. } | Storage::Image(image) => Some(image),
|
||||
Storage::Texels(_) | Storage::Shadow { .. } => None,
|
||||
match texture.stored() {
|
||||
Stored::Made(Storage::Alias { image, .. } | Storage::Image(image)) => Some(image),
|
||||
Stored::Made(Storage::Texels(_) | Storage::Shadow { .. }) | Stored::Unmade(_) => None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -239,7 +239,7 @@ use super::requirements::Query;
|
||||
use super::stand_in::StandIn;
|
||||
use super::{
|
||||
image_aspects, image_error, pages_hold, texel_units, DetachedImage, IdUse, Image, ImageObjects,
|
||||
ImagePlacement, ImageSwap, KeptResolves, Owner, Raw, Remade, Start, Storage, Texture,
|
||||
ImagePlacement, ImageSwap, KeptResolves, Owner, Raw, Remade, Start, Storage, Stored, Texture,
|
||||
TextureDescriptor, ViewRecord,
|
||||
};
|
||||
use crate::address::ObjectsToken;
|
||||
@@ -3923,7 +3923,7 @@ impl Device {
|
||||
let (textures, _) = heap.textures_from(0);
|
||||
let mut swaps: Vec<ImageSwap> = Vec::new();
|
||||
for texture in &textures {
|
||||
let Storage::Image(image) = texture.storage() else {
|
||||
let Stored::Made(Storage::Image(image)) = texture.stored() else {
|
||||
continue;
|
||||
};
|
||||
let Owner::Heap(place) = &image.owner else {
|
||||
@@ -3997,7 +3997,7 @@ impl Device {
|
||||
.facts(self.compile_device().profile());
|
||||
let (textures, _) = heap.textures_from(0);
|
||||
for texture in &textures {
|
||||
let Storage::Image(image) = texture.storage() else {
|
||||
let Stored::Made(Storage::Image(image)) = texture.stored() else {
|
||||
continue;
|
||||
};
|
||||
let Owner::Heap(place) = &image.owner else {
|
||||
|
||||
@@ -70,7 +70,7 @@ use super::attached_reads::linear_feedback_candidate;
|
||||
use super::route::HostLie;
|
||||
use super::{
|
||||
first_color_subresource, pages_hold, FirstMove, Image, ImageObjects, ImageSwap, KeptResolves,
|
||||
KeyMap, LinearMade, LinearRefusal, ObjectsToken, Owner, Raw, Remade, Storage, Texture,
|
||||
KeyMap, LinearMade, LinearRefusal, ObjectsToken, Owner, Raw, Remade, Storage, Stored, Texture,
|
||||
};
|
||||
use crate::binding_view::VkView;
|
||||
use crate::buffer::{Buffer, InPlaceWatch, ReadApart};
|
||||
@@ -224,8 +224,8 @@ impl Texture {
|
||||
/// call waits for (`Image::settle`): the device's check's round (`in_place_check.rs`). `None`
|
||||
/// where the texture is no image aliasing its bytes.
|
||||
pub(crate) fn settle_in_place(&self) -> Option<Result<(), Error>> {
|
||||
match self.storage() {
|
||||
Storage::Alias { image, .. } => Some(image.settle()),
|
||||
match self.stored() {
|
||||
Stored::Made(Storage::Alias { image, .. }) => Some(image.settle()),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@@ -237,7 +237,7 @@ impl Texture {
|
||||
/// `None` where the texture is no image aliasing its bytes, or its image has no feedback loop
|
||||
/// usage.
|
||||
pub(crate) fn settle_feedback_moves(&self) -> Option<Result<(), Error>> {
|
||||
let Storage::Alias { image, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Alias { image, .. }) = self.stored() else {
|
||||
return None;
|
||||
};
|
||||
let plan = image.plan();
|
||||
@@ -275,7 +275,7 @@ impl Texture {
|
||||
&self,
|
||||
draw: &mut crate::check_draw::CheckDraw,
|
||||
) -> Option<Result<(), Error>> {
|
||||
let Storage::Alias { image, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Alias { image, .. }) = self.stored() else {
|
||||
return None;
|
||||
};
|
||||
let plan = image.plan();
|
||||
@@ -311,7 +311,7 @@ impl Texture {
|
||||
texel: ShadowTexelView,
|
||||
(width, height): (u32, u32),
|
||||
) -> Option<Result<(), Error>> {
|
||||
let Storage::Alias { image, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Alias { image, .. }) = self.stored() else {
|
||||
return None;
|
||||
};
|
||||
use metal2vulkan::vk::{
|
||||
|
||||
@@ -0,0 +1,215 @@
|
||||
//! A shadow left unmade until a reach needs it: a program's texture over a buffer's bytes whose
|
||||
//! image the device refused for a reason that leaves its rows in place (`texture/texel_rows.rs`)
|
||||
//! is a shadow (`shadow.rs`) to every reach but a slot of a function that only reads, writes or
|
||||
//! asks the size of it, which binds its rows. So its shadow is planned and checked as the texture
|
||||
//! is made (`Device::storage_over_buffer`: its image's plan and usage, its copies' views, how it
|
||||
//! starts), and made at the first reach of the texture's storage ([`Texture::storage`]): a slot
|
||||
//! that binds the shadow, a residency (`use_resource`), a pass's attachment, a blit of its image, a
|
||||
//! view, its `VkImage` handed out, a CPU access. A texture only ever bound through its rows makes
|
||||
//! none (`WorkCounts::shadows_left_unmade`, `shadows_made_at_use`).
|
||||
//!
|
||||
//! - **Which.** A texture whose rows are in place (`TextureFacts::texel_rows`), its shadow not one
|
||||
//! that waits for its pages' in-place verdict (`texture/storage_form.rs`): every other shadow is
|
||||
//! made with its texture.
|
||||
//! - **Until it is made** the texture holds no image. Its resource ID holds no slot in the
|
||||
//! device's texture table and heap sets ([`heap_sets::place`] places it as its shadow is made),
|
||||
//! so a read through its ID that no command named reads the neutral, where a shadow made with the
|
||||
//! texture read whatever its image held: nothing copies into a shadow no command names
|
||||
//! (`shadow.rs`). A use of the texture names the key planned with its shadow
|
||||
//! ([`ShadowRecipe::identity`]), so a use before the making and one after name one resource; it
|
||||
//! has no copies, as nothing is copied into or out of a shadow before a command uses it.
|
||||
//! - **The making** is the texture's making's, once, under the texture's lock: the image as its
|
||||
//! memory lies (or as the plan says it starts), its views, its copies, its notice
|
||||
//! (`shadowed-texture`) and shadow log line, its counts; then its slot is placed and a detach of
|
||||
//! its bytes reaches its image (`NotedTexture`), as at a texture's making. A slot that binds it
|
||||
//! copies the bytes in before its command, as before the first command that uses any shadow:
|
||||
//! the copy is a command of the encoder's own at that point (`encoder.rs`), so it reads what the
|
||||
//! commands before it wrote through the rows, ordered after them (a rows binding's use is a use
|
||||
//! of the bytes, `Texture::rows_use`). A kept list of resident textures' shadows is listed
|
||||
//! again (`DeviceShared::usage_shadows_made`, `shadow::ResidentShadows`).
|
||||
//! - **Out of memory** at the making fails the call that reached it, with the error the texture's
|
||||
//! making would have given; the texture stays unmade, and a later reach makes it again.
|
||||
|
||||
use super::{Storage, Texture};
|
||||
use crate::buffer_texture::Texels;
|
||||
use crate::device::lock;
|
||||
use crate::error::Error;
|
||||
use crate::heap_sets;
|
||||
use crate::image_plan::ImagePlan;
|
||||
use crate::resource::Identity;
|
||||
use crate::texture_descriptor::{TextureDescriptor, TextureLayout};
|
||||
use crate::Device;
|
||||
use ash::vk;
|
||||
use metal2vulkan::bind::{ShadowMergeRead, ShadowTexelView};
|
||||
use metal2vulkan::vk::Format;
|
||||
use std::sync::atomic::Ordering;
|
||||
use std::sync::{Arc, Mutex, OnceLock};
|
||||
|
||||
/// A texture over a buffer's shadow as its making planned and checked it, to make
|
||||
/// (`Device::made_shadow`).
|
||||
pub(in crate::texture) struct ShadowRecipe {
|
||||
/// The call that made the texture, which its notice names.
|
||||
pub(in crate::texture) call: &'static str,
|
||||
/// The buffer's bytes the texture is over.
|
||||
pub(in crate::texture) texels: Arc<Texels>,
|
||||
pub(in crate::texture) descriptor: TextureDescriptor,
|
||||
pub(in crate::texture) layout: TextureLayout,
|
||||
/// The shadow image's plan, its undeclared usage and its views' usage in it.
|
||||
pub(in crate::texture) plan: ImagePlan,
|
||||
/// Its copies' views: the integer view a dispatch copies back through
|
||||
/// (`shadow_copy_back.rs`), or the view of its own format its merges read
|
||||
/// (`shadow_merge.rs`).
|
||||
pub(in crate::texture) views: (
|
||||
Option<(Format, ShadowTexelView, bool)>,
|
||||
Option<ShadowMergeRead>,
|
||||
),
|
||||
/// The aspects its copies move.
|
||||
pub(in crate::texture) aspects: vk::ImageAspectFlags,
|
||||
/// How its image starts, where not as its memory lies.
|
||||
pub(in crate::texture) start: Option<super::Start>,
|
||||
/// The image's identity, its key taken as the texture is made: a use of the texture names
|
||||
/// it before the image is made too.
|
||||
pub(in crate::texture) identity: Identity,
|
||||
/// Whether it is a device copy of host pages, which degrades nothing.
|
||||
pub(in crate::texture) device_copy: bool,
|
||||
/// Why the texture is a shadow: its notice's reason.
|
||||
pub(in crate::texture) why: String,
|
||||
}
|
||||
|
||||
/// What a texture over a buffer is made over (`Device::storage_over_buffer`): its storage, or the
|
||||
/// shadow it plans, to make.
|
||||
pub(in crate::texture) enum Over {
|
||||
Storage(Storage),
|
||||
Shadow(Box<ShadowRecipe>),
|
||||
}
|
||||
|
||||
/// A shadow left unmade (the module docs): its recipe, and its storage once made.
|
||||
pub(in crate::texture) struct LazyShadow {
|
||||
pub(in crate::texture) recipe: ShadowRecipe,
|
||||
made: OnceLock<Storage>,
|
||||
/// Held while the shadow is made, so one reach makes it.
|
||||
making: Mutex<()>,
|
||||
}
|
||||
|
||||
impl LazyShadow {
|
||||
pub(in crate::texture) fn new(recipe: ShadowRecipe) -> LazyShadow {
|
||||
LazyShadow {
|
||||
recipe,
|
||||
made: OnceLock::new(),
|
||||
making: Mutex::new(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A texture's storage as its parts hold it: made with the texture, or a shadow left unmade until
|
||||
/// a reach makes it (the module docs).
|
||||
pub(in crate::texture) enum StorageCell {
|
||||
Made(Storage),
|
||||
Lazy(Box<LazyShadow>),
|
||||
}
|
||||
|
||||
/// A texture's storage as made so far ([`Texture::stored`]): made, or its shadow's recipe while it
|
||||
/// is unmade.
|
||||
pub(in crate::texture) enum Stored<'a> {
|
||||
Made(&'a Storage),
|
||||
Unmade(&'a ShadowRecipe),
|
||||
}
|
||||
|
||||
impl StorageCell {
|
||||
/// Its storage, where made.
|
||||
pub(in crate::texture) fn made(&self) -> Option<&Storage> {
|
||||
match self {
|
||||
StorageCell::Made(storage) => Some(storage),
|
||||
StorageCell::Lazy(lazy) => lazy.made.get(),
|
||||
}
|
||||
}
|
||||
|
||||
/// As made so far.
|
||||
pub(in crate::texture) fn stored(&self) -> Stored<'_> {
|
||||
match self {
|
||||
StorageCell::Made(storage) => Stored::Made(storage),
|
||||
StorageCell::Lazy(lazy) => match lazy.made.get() {
|
||||
Some(storage) => Stored::Made(storage),
|
||||
None => Stored::Unmade(&lazy.recipe),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
/// The generation its objects are of, or a shadow's left unmade would be of: its bytes'.
|
||||
pub(in crate::texture) fn generation(&self) -> &Device {
|
||||
match self.stored() {
|
||||
Stored::Made(storage) => storage.generation(),
|
||||
Stored::Unmade(recipe) => recipe.texels.generation(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Whether its image's `VkImage` was handed out; never one not made.
|
||||
pub(in crate::texture) fn handed_out(&self) -> bool {
|
||||
self.made().is_some_and(Storage::handed_out)
|
||||
}
|
||||
|
||||
/// Where an automatic or placement heap's texture's image lies in its heap; never a shadow's.
|
||||
pub(in crate::texture) fn heap_place(&self) -> Option<&super::heap::HeapPlace> {
|
||||
self.made().and_then(Storage::heap_place)
|
||||
}
|
||||
|
||||
/// The texture objects over an image or texels of the texture's own; never a shadow's.
|
||||
pub(in crate::texture) fn objects(&self) -> Option<&crate::address::ObjectsToken> {
|
||||
self.made().and_then(Storage::objects)
|
||||
}
|
||||
}
|
||||
|
||||
impl Texture {
|
||||
/// Whether the texture's shadow is left unmade (the module docs).
|
||||
pub(crate) fn shadow_unmade(&self) -> bool {
|
||||
matches!(self.stored(), Stored::Unmade(_))
|
||||
}
|
||||
|
||||
/// Make the texture's shadow where it is left unmade (the module docs): at a reach that
|
||||
/// names the texture's image to the GPU before its later questions of the image ask it made
|
||||
/// (a slot that binds the image, a residency, a pass's attachment, an execution of commands
|
||||
/// that may bind it). Refused as its making is.
|
||||
pub(crate) fn made_for_use(&self) -> Result<(), Error> {
|
||||
self.storage().map(drop)
|
||||
}
|
||||
|
||||
/// The texture's storage as made so far, its shadow's recipe while that is left unmade (the
|
||||
/// module docs): what a reach that must not make it reads (its rows' binding, its placement,
|
||||
/// its facts, its shape and options).
|
||||
pub(in crate::texture) fn stored(&self) -> Stored<'_> {
|
||||
match self.presented() {
|
||||
Some(storage) => Stored::Made(storage),
|
||||
None => self.s().storage.stored(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Its shadow left unmade, made (the module docs): the storage [`Texture::storage`] answers.
|
||||
/// Refused as its making is.
|
||||
pub(in crate::texture) fn made_lazily(&self) -> Result<&Storage, Error> {
|
||||
let parts = self.s();
|
||||
let lazy = match &parts.storage {
|
||||
super::StorageCell::Made(storage) => return Ok(storage),
|
||||
super::StorageCell::Lazy(lazy) => lazy,
|
||||
};
|
||||
let storage = {
|
||||
let _making = lock(&lazy.making);
|
||||
if let Some(made) = lazy.made.get() {
|
||||
return Ok(made);
|
||||
}
|
||||
let device = lazy.recipe.texels.generation();
|
||||
let storage = device.made_shadow(&lazy.recipe)?;
|
||||
lazy.made.get_or_init(|| storage)
|
||||
};
|
||||
let device = storage.generation();
|
||||
device.shared().counts.shadow_made_at_use();
|
||||
// A kept list of the resident textures' shadows is listed again.
|
||||
(device.shared().usage_shadows_made).fetch_add(1, Ordering::Release);
|
||||
// A detach of its bytes reaches its image, and its slot holds it from now on, as at a
|
||||
// texture's making.
|
||||
self.note_over_bytes();
|
||||
if self.0.id.id().0 != 0 {
|
||||
heap_sets::place(device, self);
|
||||
}
|
||||
Ok(storage)
|
||||
}
|
||||
}
|
||||
@@ -165,7 +165,7 @@ impl Texture {
|
||||
call: &'static str,
|
||||
record: &ViewRecord,
|
||||
) -> Result<Storage, Error> {
|
||||
let Storage::Shadow { texels, .. } = self.storage() else {
|
||||
let Storage::Shadow { texels, .. } = self.storage()? else {
|
||||
return Err(internal("a rotated texture without its plane's rows"));
|
||||
};
|
||||
let rotation = record.presented.rotation;
|
||||
|
||||
@@ -30,7 +30,7 @@ use super::super::texture_descriptor::TextureDescriptor;
|
||||
use super::super::values::StorageMode;
|
||||
use super::super::view_plan::ViewRecord;
|
||||
use super::super::Device;
|
||||
use super::{image_error, IdUse, Initial, Owner, Storage, Texture};
|
||||
use super::{image_error, IdUse, Initial, Owner, Storage, Stored, Texture};
|
||||
use metal2vulkan::metal::TextureType;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -184,7 +184,7 @@ impl Device {
|
||||
}
|
||||
let record = &texture.0.record;
|
||||
self.check_texture_placement(CALL, placement, record.usage, record.texture_type)?;
|
||||
let storage = match texture.storage() {
|
||||
let storage = match texture.storage()? {
|
||||
Storage::Image(image) => Storage::Image(Arc::clone(image)),
|
||||
Storage::Texels(texels) => Storage::Texels(Arc::clone(texels)),
|
||||
Storage::Alias { .. } | Storage::Shadow { .. } => {
|
||||
@@ -207,8 +207,8 @@ impl Texture {
|
||||
pub fn is_shareable(&self) -> bool {
|
||||
let _held = self.hold();
|
||||
self.0.parent.is_none()
|
||||
&& match self.storage() {
|
||||
Storage::Image(image) => {
|
||||
&& match self.stored() {
|
||||
Stored::Made(Storage::Image(image)) => {
|
||||
matches!(
|
||||
image.owner,
|
||||
Owner::Runtime {
|
||||
@@ -217,8 +217,9 @@ impl Texture {
|
||||
}
|
||||
)
|
||||
}
|
||||
Storage::Texels(texels) => texels.home == TexelsHome::Shared,
|
||||
Storage::Alias { .. } | Storage::Shadow { .. } => false,
|
||||
Stored::Made(Storage::Texels(texels)) => texels.home == TexelsHome::Shared,
|
||||
Stored::Made(Storage::Alias { .. } | Storage::Shadow { .. })
|
||||
| Stored::Unmade(_) => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -132,7 +132,8 @@
|
||||
//! (`scheduler/inbox.rs`).
|
||||
|
||||
use super::{
|
||||
texture_aspects, AliasCount, Image, ImageObjects, Owner, Storage, Texture, TextureShared,
|
||||
texture_aspects, AliasCount, Image, ImageObjects, Owner, Storage, Stored, Texture,
|
||||
TextureShared,
|
||||
};
|
||||
use crate::buffer_texture::Texels;
|
||||
use crate::degradation::Degradation;
|
||||
@@ -560,7 +561,7 @@ impl Texture {
|
||||
// A texture with faces takes its form on the face it presents, for good
|
||||
// (`texture/faces.rs`).
|
||||
self.freeze_faces();
|
||||
let Storage::Image(image) = self.storage() else {
|
||||
let Stored::Made(Storage::Image(image)) = self.stored() else {
|
||||
return;
|
||||
};
|
||||
let form = &image.form;
|
||||
@@ -601,7 +602,7 @@ impl Texture {
|
||||
// The handle is the face the texture presents, for good (`texture/faces.rs`).
|
||||
self.freeze_faces();
|
||||
let image = self.image()?;
|
||||
let lies_in = match self.storage() {
|
||||
let lies_in = match self.storage()? {
|
||||
Storage::Alias { texels, .. } => Some(texels.buffer.at(0).0),
|
||||
_ => None,
|
||||
};
|
||||
@@ -618,9 +619,9 @@ impl Texture {
|
||||
/// move no more then ceasing to wait (it moved, its image was handed out, or its verdicts or
|
||||
/// its bytes keep it a shadow).
|
||||
fn storage_form_wanted(&self) -> Option<Wanted> {
|
||||
let image = match self.storage() {
|
||||
Storage::Image(image) => image,
|
||||
Storage::Shadow { .. } => return self.move_wanted(),
|
||||
let image = match self.stored() {
|
||||
Stored::Made(Storage::Image(image)) => image,
|
||||
Stored::Made(Storage::Shadow { .. }) => return self.move_wanted(),
|
||||
_ => return None,
|
||||
};
|
||||
if image.form.taken.get().is_some() || image.form.exported.load(Ordering::Relaxed) {
|
||||
@@ -639,7 +640,7 @@ impl Texture {
|
||||
/// was made.
|
||||
fn move_wanted(&self) -> Option<Wanted> {
|
||||
let shared = self.s();
|
||||
let Storage::Shadow { image, texels, .. } = &shared.storage else {
|
||||
let Some(Storage::Shadow { image, texels, .. }) = shared.storage.made() else {
|
||||
return None;
|
||||
};
|
||||
let mut pending = lock(&shared.pending_move);
|
||||
@@ -797,7 +798,7 @@ impl Texture {
|
||||
/// queues with its own fences and events.
|
||||
fn shadow_goes_after_move(&self, core: &mut EncoderCore, pooled: bool) -> Arc<AtomicBool> {
|
||||
let moved = Arc::new(AtomicBool::new(false));
|
||||
let Storage::Shadow { image, copies, .. } = &self.s().storage else {
|
||||
let Some(Storage::Shadow { image, copies, .. }) = self.s().storage.made() else {
|
||||
return moved;
|
||||
};
|
||||
if !image.identity.tracked {
|
||||
@@ -833,7 +834,7 @@ impl Texture {
|
||||
/// moves with.
|
||||
pub(crate) fn wait_to_move_in_place(&self, pending: in_place::PendingMove) {
|
||||
let shared = self.s();
|
||||
let Storage::Shadow { texels, .. } = &shared.storage else {
|
||||
let Some(Storage::Shadow { texels, .. }) = shared.storage.made() else {
|
||||
return;
|
||||
};
|
||||
let wait = MoveWait {
|
||||
@@ -888,7 +889,7 @@ impl Prepared {
|
||||
let Kind::Form { plan, swapped } = &self.kind else {
|
||||
return None;
|
||||
};
|
||||
let Storage::Image(image) = texture.storage() else {
|
||||
let Stored::Made(Storage::Image(image)) = texture.stored() else {
|
||||
return None;
|
||||
};
|
||||
let Owner::Runtime { placement: old, .. } = &image.owner else {
|
||||
@@ -938,7 +939,7 @@ impl Prepared {
|
||||
return false;
|
||||
};
|
||||
let shared = texture.s();
|
||||
let Storage::Shadow { image: shadow, .. } = &shared.storage else {
|
||||
let Some(Storage::Shadow { image: shadow, .. }) = shared.storage.made() else {
|
||||
return false;
|
||||
};
|
||||
if texture.shadowed_again() {
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
//! writes both through the shadow and through the rows merges them, as for any other use of the
|
||||
//! bytes.
|
||||
|
||||
use super::{Storage, Texture};
|
||||
use super::{Storage, Stored, Texture};
|
||||
use crate::buffer_texture::Texels;
|
||||
use crate::error::{internal, Error};
|
||||
use crate::resource::ResourceKey;
|
||||
@@ -120,15 +120,17 @@ impl Texture {
|
||||
/// whose rows are (the module docs).
|
||||
fn rows_texels(&self) -> Result<(&Texels, &RowsInPlace), Error> {
|
||||
let rows = self.s().rows_in_place.as_ref();
|
||||
let texels = match self.storage() {
|
||||
Storage::Shadow { texels, copies, .. } => match &copies.source {
|
||||
// A shadow left unmade is over the bytes its rows are (`texture/lazy_shadow.rs`).
|
||||
let texels = match self.stored() {
|
||||
Stored::Made(Storage::Shadow { texels, copies, .. }) => match &copies.source {
|
||||
ShadowSource::Bytes {
|
||||
target: ShadowTarget::Image { .. },
|
||||
..
|
||||
} => Some(&**texels),
|
||||
_ => None,
|
||||
},
|
||||
_ => None,
|
||||
Stored::Unmade(recipe) => Some(&*recipe.texels),
|
||||
Stored::Made(_) => None,
|
||||
};
|
||||
match (texels, rows) {
|
||||
(Some(texels), Some(rows)) => Ok((texels, rows)),
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
//! which a command that makes the texture resident for writing through it names in its uses
|
||||
//! (`binding.rs`). It is exact and announces nothing.
|
||||
|
||||
use super::{Image, Owner, Start, Storage, Texture};
|
||||
use super::{Image, Owner, Start, Storage, Stored, Texture};
|
||||
use crate::binding_view::binding_view;
|
||||
use crate::degradation::Degradation;
|
||||
use crate::device::lock;
|
||||
@@ -144,14 +144,9 @@ impl Texture {
|
||||
true => (ImageUsageFlags::STORAGE, TextureUsage::SHADER_WRITE),
|
||||
false => (ImageUsageFlags::SAMPLED, TextureUsage::SHADER_READ),
|
||||
};
|
||||
match self.storage() {
|
||||
Storage::Image(image)
|
||||
| Storage::Alias { image, .. }
|
||||
| Storage::Shadow { image, .. } => {
|
||||
!image.plan().usage.contains(vk) && !self.0.record.usage.contains(metal)
|
||||
}
|
||||
Storage::Texels(_) => false,
|
||||
}
|
||||
// A shadow left unmade answers by its plan (`texture/lazy_shadow.rs`).
|
||||
self.image_plan()
|
||||
.is_ok_and(|plan| !plan.usage.contains(vk) && !self.0.record.usage.contains(metal))
|
||||
}
|
||||
|
||||
/// The `VkImageView` a slot binding write of `call` needs of the texture: `desc` the binding
|
||||
@@ -391,7 +386,7 @@ impl Texture {
|
||||
if record.presented.rotation != 0 {
|
||||
return Err(Error::NotImplemented(RuntimeGap::RotatedTexture));
|
||||
}
|
||||
let (image, copies, truth) = match self.storage() {
|
||||
let (image, copies, truth) = match self.storage()? {
|
||||
Storage::Image(image) => {
|
||||
let base = match &image.owner {
|
||||
Owner::ViewShadow(shadow) => &shadow.base,
|
||||
@@ -466,7 +461,7 @@ impl Texture {
|
||||
let mut copies =
|
||||
texels.shadow_copies(image.raw.get(), image.identity, aspects, (None, None))?;
|
||||
// The texture's own image lies in the bytes too where it aliases them.
|
||||
if matches!(self.storage(), Storage::Alias { .. }) {
|
||||
if matches!(self.stored(), Stored::Made(Storage::Alias { .. })) {
|
||||
copies.backing = copies.backing.aliased();
|
||||
}
|
||||
(
|
||||
@@ -500,24 +495,29 @@ impl Texture {
|
||||
usage: record.usage,
|
||||
};
|
||||
let feedback = ImageUsageFlags::ATTACHMENT_FEEDBACK_LOOP_EXT;
|
||||
let (texels, own) = match self.storage() {
|
||||
Storage::Alias { image, texels } => {
|
||||
let usage = match image.plan().usage.contains(feedback) {
|
||||
true => "with the feedback loop usage",
|
||||
false => "without the feedback loop usage",
|
||||
};
|
||||
(
|
||||
Some(&**texels),
|
||||
format!("an aliasing image over the bytes, {usage}"),
|
||||
)
|
||||
}
|
||||
Storage::Shadow { texels, .. } => (Some(&**texels), "a shadow of the bytes".to_owned()),
|
||||
Storage::Image(_) if self.s().faces.get().is_some() => (
|
||||
None,
|
||||
"an image of its own, one of two faces that take turns (texture/faces.rs)"
|
||||
.to_owned(),
|
||||
),
|
||||
Storage::Image(_) | Storage::Texels(_) => (None, "an image of its own".to_owned()),
|
||||
let (texels, own) = match self.stored() {
|
||||
Stored::Unmade(recipe) => (Some(&*recipe.texels), "a shadow of the bytes".to_owned()),
|
||||
Stored::Made(storage) => match storage {
|
||||
Storage::Alias { image, texels } => {
|
||||
let usage = match image.plan().usage.contains(feedback) {
|
||||
true => "with the feedback loop usage",
|
||||
false => "without the feedback loop usage",
|
||||
};
|
||||
(
|
||||
Some(&**texels),
|
||||
format!("an aliasing image over the bytes, {usage}"),
|
||||
)
|
||||
}
|
||||
Storage::Shadow { texels, .. } => {
|
||||
(Some(&**texels), "a shadow of the bytes".to_owned())
|
||||
}
|
||||
Storage::Image(_) if self.s().faces.get().is_some() => (
|
||||
None,
|
||||
"an image of its own, one of two faces that take turns (texture/faces.rs)"
|
||||
.to_owned(),
|
||||
),
|
||||
Storage::Image(_) | Storage::Texels(_) => (None, "an image of its own".to_owned()),
|
||||
},
|
||||
};
|
||||
let why = format!(
|
||||
"a usage shadow: {}; the texture's own image is {own}",
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
//! `Feature::ViewFormatReinterpretation` (not representable) where the device reinterprets no
|
||||
//! components, else of `Feature::TextureView` (not implemented).
|
||||
|
||||
use super::{IdUse, Image, Owner, Storage, Texture};
|
||||
use super::{IdUse, Image, Over, Owner, Storage, Stored, Texture};
|
||||
use crate::degradation::Degradation;
|
||||
use crate::device::lock;
|
||||
use crate::error::{internal, Error, RuntimeGap};
|
||||
@@ -119,7 +119,7 @@ impl Texture {
|
||||
if let Some(storage) = self.converted_view(call, record) {
|
||||
return storage;
|
||||
}
|
||||
match self.storage() {
|
||||
match self.storage()? {
|
||||
Storage::Image(image) => {
|
||||
let base = match &image.owner {
|
||||
Owner::ViewShadow(shadow) => &shadow.base,
|
||||
@@ -166,10 +166,14 @@ impl Texture {
|
||||
let layout = descriptor
|
||||
.check(self.generation().properties().texture_rules())
|
||||
.map_err(|_| refused(None))?;
|
||||
// A view's storage never moves in place (`texture/storage_form.rs`).
|
||||
// A view's storage never moves in place (`texture/storage_form.rs`), and its
|
||||
// shadow is made with it: a view binds no rows.
|
||||
let over = (Arc::clone(texels), &mut None, &mut false);
|
||||
self.generation()
|
||||
.storage_over_buffer(call, over, &descriptor, &layout)
|
||||
let device = self.generation();
|
||||
match device.storage_over_buffer(call, over, &descriptor, &layout)? {
|
||||
Over::Storage(storage) => Ok(storage),
|
||||
Over::Shadow(recipe) => device.made_shadow(&recipe),
|
||||
}
|
||||
}
|
||||
// A texture buffer's views are texel buffer views of its bytes, which take any
|
||||
// format of its class (`Texture::view`).
|
||||
@@ -184,7 +188,7 @@ impl Texture {
|
||||
&self,
|
||||
record: &ViewRecord,
|
||||
) -> Option<(Arc<Image>, (PixelFormat, TextureSwizzleChannels))> {
|
||||
let Storage::Image(image) = self.storage() else {
|
||||
let Stored::Made(Storage::Image(image)) = self.stored() else {
|
||||
return None;
|
||||
};
|
||||
let base = truth(image);
|
||||
@@ -202,16 +206,19 @@ impl Texture {
|
||||
|
||||
/// A texture presenting what this one's bindings present (`ViewRecord::bound`) over the same
|
||||
/// storage, where they differ: a view that reads its image in the image's own format, as a
|
||||
/// texture of that format. `None` for every other texture.
|
||||
pub(crate) fn bound_twin(&self) -> Option<Texture> {
|
||||
self.0.record.read_as?;
|
||||
Some(Texture::made(
|
||||
/// texture of that format. `None` for every other texture. Refused as the texture's storage
|
||||
/// is ([`Texture::storage`]).
|
||||
pub(crate) fn bound_twin(&self) -> Result<Option<Texture>, Error> {
|
||||
if self.0.record.read_as.is_none() {
|
||||
return Ok(None);
|
||||
}
|
||||
Ok(Some(Texture::made(
|
||||
self.generation(),
|
||||
self.storage().clone(),
|
||||
self.storage()?.clone(),
|
||||
self.0.record.bound(),
|
||||
Some(self.clone()),
|
||||
IdUse::Runtime,
|
||||
))
|
||||
)))
|
||||
}
|
||||
|
||||
/// The texture a pass renders into for a view that its bindings present in its image's own
|
||||
@@ -226,7 +233,7 @@ impl Texture {
|
||||
if let Some(shadow) = held.as_ref() {
|
||||
return Ok(shadow.clone());
|
||||
}
|
||||
let Storage::Image(image) = self.storage() else {
|
||||
let Storage::Image(image) = self.storage()? else {
|
||||
return Err(internal("a view read through its image without one"));
|
||||
};
|
||||
let record = ViewRecord {
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
//! buffer.
|
||||
|
||||
use super::ycbcr_planes::PlanesImage;
|
||||
use super::{image_error, IdUse, Image, Storage, Texture};
|
||||
use super::{image_error, IdUse, Image, Storage, StorageCell, Stored, Texture};
|
||||
use crate::address_map::AddressModeMap;
|
||||
use crate::binding_view::VkView;
|
||||
use crate::buffer_texture::{view_usage, Texels};
|
||||
@@ -276,7 +276,7 @@ impl Device {
|
||||
}
|
||||
let storage =
|
||||
self.converted_storage(call, texels, &descriptor, layout, (planes, span))?;
|
||||
let made = (storage, in_place.ok(), None);
|
||||
let made = (StorageCell::Made(storage), in_place.ok(), None);
|
||||
return Ok(Texture::made_with_planes(self, made, record, None, id_use));
|
||||
}
|
||||
// Over a surface of a P3 matrix: an image of the codes of the code-reading format, its
|
||||
@@ -474,7 +474,7 @@ impl Texture {
|
||||
call: &'static str,
|
||||
record: &ViewRecord,
|
||||
) -> Option<Result<Storage, Error>> {
|
||||
let Storage::Shadow { texels, copies, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Shadow { texels, copies, .. }) = self.stored() else {
|
||||
return None;
|
||||
};
|
||||
let ShadowSource::Converted { conversion, .. } = &copies.source else {
|
||||
@@ -548,7 +548,7 @@ impl Texture {
|
||||
call: &'static str,
|
||||
record: &ViewRecord,
|
||||
) -> Option<Result<(Storage, (PixelFormat, TextureSwizzleChannels)), Error>> {
|
||||
let Storage::Shadow { texels, copies, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Shadow { texels, copies, .. }) = self.stored() else {
|
||||
return None;
|
||||
};
|
||||
let ShadowSource::Converted { conversion, .. } = &copies.source else {
|
||||
@@ -614,7 +614,7 @@ impl Texture {
|
||||
/// Whether a pass that loads this two-plane YCbCr texture loads nothing measured: one that
|
||||
/// reads each code alone, over a surface of a P3 matrix, and an `_sRGB` twin (`ycbcr.rs`).
|
||||
pub(crate) fn ycbcr_load_unmeasured(&self) -> bool {
|
||||
let Storage::Shadow { copies, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Shadow { copies, .. }) = self.stored() else {
|
||||
return false;
|
||||
};
|
||||
let ShadowSource::Converted { conversion, .. } = &copies.source else {
|
||||
@@ -642,7 +642,7 @@ impl Texture {
|
||||
let pf = self.0.record.pixel_format;
|
||||
let gap =
|
||||
|| Error::Unsupported(Unsupported::not_implemented(Feature::Format).naming_format(pf));
|
||||
let Storage::Shadow { texels, copies, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Shadow { texels, copies, .. }) = self.stored() else {
|
||||
return Err(gap());
|
||||
};
|
||||
let ShadowSource::Converted { conversion, .. } = &copies.source else {
|
||||
@@ -775,7 +775,7 @@ impl Texture {
|
||||
let pf = self.0.record.pixel_format;
|
||||
let gap =
|
||||
|| Error::Unsupported(Unsupported::not_implemented(Feature::Format).naming_format(pf));
|
||||
let Storage::Shadow { texels, copies, .. } = self.storage() else {
|
||||
let Stored::Made(Storage::Shadow { texels, copies, .. }) = self.stored() else {
|
||||
return Err(gap());
|
||||
};
|
||||
let ShadowSource::Converted { conversion, .. } = &copies.source else {
|
||||
|
||||
@@ -554,6 +554,8 @@ pub(crate) struct Counters {
|
||||
shadowed_textures: AtomicU64,
|
||||
shadows_zeroed: AtomicU64,
|
||||
shadows_over_fresh_pages: AtomicU64,
|
||||
shadows_left_unmade: AtomicU64,
|
||||
shadows_made_at_use: AtomicU64,
|
||||
host_textures_in_place: AtomicU64,
|
||||
host_textures_in_place_written: AtomicU64,
|
||||
device_copy_textures: AtomicU64,
|
||||
@@ -4850,6 +4852,18 @@ impl Counters {
|
||||
(self.shadows_over_fresh_pages).fetch_add(1, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
/// A texture over a buffer's bytes whose rows are in place was made with its shadow left
|
||||
/// unmade (`texture/lazy_shadow.rs`).
|
||||
pub(crate) fn shadow_left_unmade(&self) {
|
||||
(self.shadows_left_unmade).fetch_add(1, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
/// A shadow left unmade was made at the first reach of its texture's image
|
||||
/// (`texture/lazy_shadow.rs`).
|
||||
pub(crate) fn shadow_made_at_use(&self) {
|
||||
(self.shadows_made_at_use).fetch_add(1, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
/// A texture over host pages was made a device copy of them (`texture.rs`).
|
||||
pub(crate) fn device_copy_texture(&self) {
|
||||
self.device_copy_textures.fetch_add(1, Ordering::Relaxed);
|
||||
@@ -9716,6 +9730,16 @@ pub struct WorkCounts {
|
||||
/// (`fresh_page_buffers_made`): an image bound to imported memory starts `UNDEFINED`, and its
|
||||
/// first move may write any byte bound to it.
|
||||
pub shadows_over_fresh_pages: u64,
|
||||
/// Textures over a buffer's bytes whose rows are in place (`TextureFacts::texel_rows`), made
|
||||
/// with their shadow left unmade: a slot that only reads, writes or asks the size of one binds
|
||||
/// its rows, and its shadow is made at the first reach of its image
|
||||
/// (`shadows_made_at_use`, `texture/lazy_shadow.rs`). One only ever bound through its rows
|
||||
/// makes none, nor counts in `shadowed_textures`.
|
||||
pub shadows_left_unmade: u64,
|
||||
/// Of `shadows_left_unmade`, those whose shadow a reach made since: a slot that binds the
|
||||
/// image, a residency (`use_resource`), a pass's attachment, a view, a handed-out `VkImage`,
|
||||
/// each counted in `shadowed_textures` as it is made.
|
||||
pub shadows_made_at_use: u64,
|
||||
/// Textures over host pages (a no-copy buffer's, a no-copy heap's buffer's, or a buffer in
|
||||
/// fresh pages it imported; or a copied host buffer's copy of them, `copied_textures_in_place`)
|
||||
/// that sample, read, render or are written through a shader, made an image aliasing the pages
|
||||
@@ -12070,6 +12094,8 @@ impl Device {
|
||||
linear_alignments_recalled: counters.linear_alignments_recalled.load(Ordering::Relaxed),
|
||||
shadowed_textures: counters.shadowed_textures.load(Ordering::Relaxed),
|
||||
shadows_over_fresh_pages: counters.shadows_over_fresh_pages.load(Ordering::Relaxed),
|
||||
shadows_left_unmade: counters.shadows_left_unmade.load(Ordering::Relaxed),
|
||||
shadows_made_at_use: counters.shadows_made_at_use.load(Ordering::Relaxed),
|
||||
host_textures_in_place: counters.host_textures_in_place.load(Ordering::Relaxed),
|
||||
host_textures_in_place_written: counters
|
||||
.host_textures_in_place_written
|
||||
|
||||
Vendored
+1
-1
@@ -94,7 +94,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 522;
|
||||
/// changes no behaviour, and then updates that hash alone with the commit saying why, or changes
|
||||
/// behaviour and also bumps this version. The commit that bumps it says what changed; this comment
|
||||
/// keeps no history.
|
||||
pub const RUNTIME_VERSION: u32 = 2308;
|
||||
pub const RUNTIME_VERSION: u32 = 2309;
|
||||
|
||||
/// The digest of the sources this build of the crate was compiled from: SHA-256, as lowercase hex,
|
||||
/// of the manifest, the build script, and exactly the files the crate roots' module tree compiles
|
||||
|
||||
@@ -3603,6 +3603,8 @@ field metal2vulkan-runtime::WorkCounts.shadow_texels_unskipped_truth_written pub
|
||||
field metal2vulkan-runtime::WorkCounts.shadow_texels_unskipped_unnamed_since pub shadow_texels_unskipped_unnamed_since: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadow_texels_unskipped_unstanding pub shadow_texels_unskipped_unstanding: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadowed_textures pub shadowed_textures: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadows_left_unmade pub shadows_left_unmade: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadows_made_at_use pub shadows_made_at_use: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadows_over_fresh_pages pub shadows_over_fresh_pages: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadows_sharing_truth pub shadows_sharing_truth: u64
|
||||
field metal2vulkan-runtime::WorkCounts.shadows_zeroed pub shadows_zeroed: u64
|
||||
|
||||
|
Can't render this file because it is too large.
|
@@ -481,6 +481,13 @@ binds its rows as a texel buffer of the buffer's bytes (the pages, or the buffer
|
||||
at a slot whose function only reads, writes or asks its size (section 5,
|
||||
`TextureFacts::texel_rows`), and those commands copy nothing into or out of the shadow
|
||||
(`WorkCounts::texel_rows_textures`, `texel_rows_bound`); a slot that samples it reads the shadow.
|
||||
Such a texture's shadow (not one made before its pages' verdicts, nor one over a heap's buffer) is
|
||||
made at the first reach of its image, not with the texture: a slot that binds the image, a
|
||||
`use_resource` of it, a render pass's attachment, an execution of commands that inherits its
|
||||
binding, a view, its `VkImage` handed out (`WorkCounts::shadows_left_unmade`,
|
||||
`shadows_made_at_use`). One only ever bound through its rows, or read and written by the CPU and
|
||||
blits, which reach its bytes, makes none, and its resource ID reads the neutral texture until its
|
||||
shadow is made, as a texture that no command named holds nothing a read through its ID could see.
|
||||
Over a buffer with a read twin, a slot that only reads the texture binds the texture's read twin
|
||||
where it has one in place, and the shadow otherwise.
|
||||
A texture in place renders and
|
||||
@@ -2338,6 +2345,8 @@ bound.
|
||||
format, rebuilding each byte from its normalized value (Vulkan defines that value as the byte over
|
||||
255), with no copy of them (`WorkCounts::shadow_merges_fetched`); every other format, the sRGB and
|
||||
16-bit float ones among them, copies them.
|
||||
A texture whose rows are in place (section 1) gives this notice as its shadow is made, at the
|
||||
first reach of its image, and one only ever bound through its rows gives none.
|
||||
- `metal2vulkan-degrade-staged-texture-buffer` (performance). `StagedTextureBuffer`: A texture
|
||||
buffer is viewed through a staging buffer: its texels start where the device views none
|
||||
(`minTexelBufferOffsetAlignment`), or run past its buffer's length, where its staging buffer is
|
||||
|
||||
Reference in new issue
Block a user