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).
482 lines
20 KiB
Rust
482 lines
20 KiB
Rust
//! A render encoder's argument buffers: the resources `use_resource(s)` and `use_heap(s)` make
|
|
//! resident in render stages, set 1, the heap, of its draws and tile dispatches, and the
|
|
//! visible-function tables each stage binds.
|
|
//!
|
|
//! - **Residency** (`residency.rs`). `useResource:usage:stages:` and `useHeap:stages:` make a
|
|
//! resource resident for the encoder's later draws and tile dispatches in the render stages they
|
|
//! name, joined with any earlier use: a draw's vertex and fragment functions reach it through
|
|
//! an address or a resource ID held in memory in those of their stages alone (the binder's
|
|
//! `UsedResource::stages`), and a tile dispatch's function only where they hold the tile stage.
|
|
//! An indirect command buffer made resident for writing is written by the GPU from then on, as
|
|
//! on a compute encoder. A stage Vulkan has no form of (object, mesh) reaches no function.
|
|
//! - **Set 1**, as a compute dispatch's: a draw or a tile dispatch whose variant has a heap lists
|
|
//! the device's sampler states that fit its sampler arrays (`heap_sets::fit_samplers`) and writes
|
|
//! its heap elements, at their resource IDs, into the command buffer's one heap set of the
|
|
//! variant (`heap_sets.rs`), which it binds as set 1. A draw records that set into the pass's
|
|
//! secondary command buffer; the set's arrays are update-after-bind, so a later command's writes
|
|
//! land after it was bound.
|
|
//! - **Visible-function tables** (`function_table.rs`): a stage's table binds at its buffer
|
|
//! index as a compute encoder's does, and a draw refuses a buffer where a stage's function
|
|
//! reads a table, or a table where it reads a buffer, as Metal's validation stops them. A draw
|
|
//! lists the live tables its state made, and a tile dispatch those of its tile function's
|
|
//! state, which its argument buffers can name.
|
|
//! - **Shadowed textures** (`shadow.rs`) a draw or a tile dispatch reaches through the residency
|
|
//! are gathered with its bound ones and copied around its render pass instance, or around the
|
|
//! dispatch (`render/shadows.rs`).
|
|
|
|
use super::RenderCommandEncoder;
|
|
use super::RenderLowering;
|
|
use super::{RenderCall, Table};
|
|
use crate::error::Error;
|
|
use crate::function_table::VisibleFunctionTable;
|
|
use crate::heap::Heap;
|
|
use crate::pvrtc::degrade_unreadable;
|
|
use crate::replay::{CallLog, Resource};
|
|
use crate::resource::ResourceRef;
|
|
use crate::work_counts::LoggedCall;
|
|
use metal2vulkan::metal::{RenderStages, ResourceUsage};
|
|
|
|
impl RenderLowering {
|
|
/// The lowering of [`RenderCommandEncoder::use_resource`].
|
|
pub(crate) fn use_resource(
|
|
&mut self,
|
|
resource: ResourceRef<'_>,
|
|
usage: ResourceUsage,
|
|
stages: RenderStages,
|
|
) -> Result<(), Error> {
|
|
self.log_use(&[resource], |_| {
|
|
RenderCall::UseResource(Resource::one(resource), usage, stages)
|
|
});
|
|
self.use_all("use_resource", &[resource], usage, stages)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::use_resources`].
|
|
pub(crate) fn use_resources(
|
|
&mut self,
|
|
resources: &[ResourceRef<'_>],
|
|
usage: ResourceUsage,
|
|
stages: RenderStages,
|
|
) -> Result<(), Error> {
|
|
self.log_use(resources, |_| {
|
|
RenderCall::UseResources(Resource::all(resources), usage, stages)
|
|
});
|
|
self.use_all("use_resources", resources, usage, stages)
|
|
}
|
|
|
|
/// [`log`](Self::log) a use of `resources`, which keeps the encoder's kept draws
|
|
/// ([`log_across`](Self::log_across)) but where one is a memoryless texture, which fails
|
|
/// the command buffer (`render/draw_again.rs`): a use that changes the encoder's residency
|
|
/// gives it a new generation, which makes the next draw of each take every step
|
|
/// (`draw_again::Under`), and one that changes nothing makes nothing resident.
|
|
fn log_use(
|
|
&mut self,
|
|
resources: &[ResourceRef<'_>],
|
|
call: impl FnOnce(&mut CallLog<RenderCall>) -> RenderCall,
|
|
) {
|
|
match resources.iter().any(ResourceRef::is_memoryless) {
|
|
true => self.log_letting_go(LoggedCall::Use, call),
|
|
false => self.log_across(LoggedCall::Use, call),
|
|
}
|
|
}
|
|
|
|
fn use_all(
|
|
&mut self,
|
|
call: &'static str,
|
|
resources: &[ResourceRef<'_>],
|
|
usage: ResourceUsage,
|
|
stages: RenderStages,
|
|
) -> Result<(), Error> {
|
|
for resource in resources {
|
|
self.core.check_device(call, resource.device())?;
|
|
}
|
|
// A memoryless texture fails the command buffer from the pass on, with no draw after it
|
|
// too (`RenderCommandEncoder::use_resource`).
|
|
if resources.iter().any(ResourceRef::is_memoryless) {
|
|
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`).
|
|
if let ResourceRef::IndirectCommandBuffer(icb) = resource {
|
|
icb.hold_records(&mut self.core, usage.contains(ResourceUsage::WRITE));
|
|
}
|
|
if let Some(used) = self.residency.use_resource(resource, usage, stages) {
|
|
self.core.made_resident(used);
|
|
}
|
|
if let ResourceRef::IndirectCommandBuffer(icb) = resource {
|
|
if usage.contains(ResourceUsage::WRITE) {
|
|
self.core.routes.writable(icb);
|
|
self.core.retain(icb.gpu_write());
|
|
}
|
|
}
|
|
}
|
|
Ok(())
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::use_heap`].
|
|
pub(crate) fn use_heap(&mut self, heap: &Heap, stages: RenderStages) -> Result<(), Error> {
|
|
// As a use of resources keeps the encoder's kept draws (`log_use`).
|
|
self.log_across(LoggedCall::Use, |_| {
|
|
RenderCall::UseHeap(heap.clone(), stages)
|
|
});
|
|
self.use_heaps_of("use_heap", &[heap], stages)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::use_heaps`].
|
|
pub(crate) fn use_heaps(&mut self, heaps: &[&Heap], stages: RenderStages) -> Result<(), Error> {
|
|
self.log_across(LoggedCall::Use, |_| {
|
|
RenderCall::UseHeaps(heaps.iter().map(|&heap| heap.clone()).collect(), stages)
|
|
});
|
|
self.use_heaps_of("use_heaps", heaps, stages)
|
|
}
|
|
|
|
fn use_heaps_of(
|
|
&mut self,
|
|
call: &'static str,
|
|
heaps: &[&Heap],
|
|
stages: RenderStages,
|
|
) -> Result<(), Error> {
|
|
for heap in heaps {
|
|
self.core.check_device(call, heap.generation())?;
|
|
}
|
|
for heap in heaps {
|
|
for used in self.residency.use_heap(heap, stages) {
|
|
self.core.made_resident(used);
|
|
}
|
|
}
|
|
Ok(())
|
|
}
|
|
|
|
/// Make resident the textures made since the encoder's last command in the heaps it used
|
|
/// (`Residency::sync_heaps`), held until the command buffer completes: a draw, a tile
|
|
/// dispatch and an execution of render commands reach every texture their heaps hold as
|
|
/// they are encoded.
|
|
pub(super) fn sync_heaps(&mut self) {
|
|
for used in self.residency.sync_heaps() {
|
|
self.core.retain(used);
|
|
}
|
|
}
|
|
|
|
/// Once a command was encoded, note the heaps the encoder used; and where its functions read
|
|
/// texture handles from memory in render stages `reads`, the textures they reach whose
|
|
/// blocks a carrier holds.
|
|
pub(super) fn command_encoded(&mut self, reads: RenderStages) {
|
|
// The command, encoded, used the heaps of what the encoder made resident: noted once a
|
|
// change of it, as an earlier command noted those it held then.
|
|
let generation = self.residency.generation();
|
|
if self.heaps_noted != Some(generation) {
|
|
let heaps = self.residency.resident_heaps();
|
|
self.core.touch_heaps(heaps.iter().cloned());
|
|
self.heaps_noted = Some(generation);
|
|
}
|
|
if reads.is_empty() {
|
|
return;
|
|
}
|
|
// A texture the functions' handles reach whose blocks a carrier holds reads as the
|
|
// neutral: those made resident in the stages that read handles, and those bound there.
|
|
let tables = [
|
|
(RenderStages::VERTEX, &self.vertex),
|
|
(RenderStages::FRAGMENT, &self.fragment),
|
|
(RenderStages::OBJECT, &self.object),
|
|
(RenderStages::MESH, &self.mesh),
|
|
(RenderStages::TILE, &self.tile),
|
|
];
|
|
let bound = tables
|
|
.into_iter()
|
|
.filter(|(stage, _)| reads.intersects(*stage))
|
|
.flat_map(|(_, table)| table.textures.values());
|
|
let device = self.core.device();
|
|
let resident = (self.unreadable).reached(device, &self.residency, reads);
|
|
degrade_unreadable(device, resident.chain(bound), "a draw or tile dispatch");
|
|
}
|
|
}
|
|
|
|
impl RenderCommandEncoder {
|
|
/// `useResource:usage:stages:`: the encoder's later draws and tile dispatches may reach
|
|
/// `resource` in render `stages` through an address or a resource ID held in memory, reading
|
|
/// or writing as `usage` says (the module docs). A memoryless texture, a texture buffer too,
|
|
/// fails the command buffer from the pass on as plain Metal's does, with no draw after it too
|
|
/// (`CommandBufferError::InvalidResource`, an M3 Max under macOS 27.0.1).
|
|
///
|
|
/// Refused, changing nothing: a resource of another device (`Invalid`).
|
|
pub fn use_resource(
|
|
&mut self,
|
|
resource: ResourceRef<'_>,
|
|
usage: ResourceUsage,
|
|
stages: RenderStages,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => self.at_call(|lowering| lowering.use_resource(resource, usage, stages)),
|
|
false => {
|
|
self.defer(|_| RenderCall::UseResource(Resource::one(resource), usage, stages))
|
|
}
|
|
}
|
|
}
|
|
|
|
/// `useResources:count:usage:stages:`: [`use_resource`](Self::use_resource) of each of
|
|
/// `resources`, refused, changing nothing, as it is for any of them.
|
|
pub fn use_resources(
|
|
&mut self,
|
|
resources: &[ResourceRef<'_>],
|
|
usage: ResourceUsage,
|
|
stages: RenderStages,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => self.at_call(|lowering| lowering.use_resources(resources, usage, stages)),
|
|
false => {
|
|
self.defer(|_| RenderCall::UseResources(Resource::all(resources), usage, stages))
|
|
}
|
|
}
|
|
}
|
|
|
|
/// `useHeap:stages:`: the encoder's later draws and tile dispatches may read every buffer
|
|
/// placed in `heap` in render `stages` through an address held in memory, and every texture
|
|
/// made in it or over a buffer placed in it through its resource ID, as Metal's contract makes
|
|
/// a heap's resources resident for reading only (`residency.rs`): the textures that live now,
|
|
/// and each made later, from the first command encoded after it is made. As Metal's, it holds
|
|
/// the heap, not its textures: one the program released, which only command buffers that
|
|
/// used the heap hold, is not made resident again.
|
|
///
|
|
/// A sparse heap's live sparse textures are made resident, as on a compute encoder.
|
|
///
|
|
/// Refused, changing nothing (`Invalid`): a heap of another device.
|
|
pub fn use_heap(&mut self, heap: &Heap, stages: RenderStages) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => self.at_call(|lowering| lowering.use_heap(heap, stages)),
|
|
false => self.defer(|_| RenderCall::UseHeap(heap.clone(), stages)),
|
|
}
|
|
}
|
|
|
|
/// `useHeaps:count:stages:`: [`use_heap`](Self::use_heap) of each of `heaps`, refused,
|
|
/// changing nothing, as it is for any of them.
|
|
pub fn use_heaps(&mut self, heaps: &[&Heap], stages: RenderStages) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => self.at_call(|lowering| lowering.use_heaps(heaps, stages)),
|
|
false => self.defer(|_| {
|
|
RenderCall::UseHeaps(heaps.iter().map(|&heap| heap.clone()).collect(), stages)
|
|
}),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl RenderLowering {
|
|
/// The lowering of [`RenderCommandEncoder::set_vertex_visible_function_table`].
|
|
pub(crate) fn set_vertex_visible_function_table(
|
|
&mut self,
|
|
table: Option<&VisibleFunctionTable>,
|
|
index: u32,
|
|
) -> Result<(), Error> {
|
|
self.log(|_| RenderCall::FunctionTable(Table::Vertex, table.cloned(), index));
|
|
const CALL: &str = "set_vertex_visible_function_table";
|
|
self.vertex
|
|
.set_function_tables(&mut self.core, CALL, &[table], index)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::set_vertex_visible_function_tables`].
|
|
pub(crate) fn set_vertex_visible_function_tables(
|
|
&mut self,
|
|
tables: &[Option<&VisibleFunctionTable>],
|
|
first: u32,
|
|
) -> Result<(), Error> {
|
|
self.log(|_| {
|
|
RenderCall::FunctionTables(
|
|
Table::Vertex,
|
|
tables.iter().map(|t| t.cloned()).collect(),
|
|
first,
|
|
)
|
|
});
|
|
const CALL: &str = "set_vertex_visible_function_tables";
|
|
self.vertex
|
|
.set_function_tables(&mut self.core, CALL, tables, first)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::set_fragment_visible_function_table`].
|
|
pub(crate) fn set_fragment_visible_function_table(
|
|
&mut self,
|
|
table: Option<&VisibleFunctionTable>,
|
|
index: u32,
|
|
) -> Result<(), Error> {
|
|
self.log(|_| RenderCall::FunctionTable(Table::Fragment, table.cloned(), index));
|
|
const CALL: &str = "set_fragment_visible_function_table";
|
|
self.fragment
|
|
.set_function_tables(&mut self.core, CALL, &[table], index)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::set_fragment_visible_function_tables`].
|
|
pub(crate) fn set_fragment_visible_function_tables(
|
|
&mut self,
|
|
tables: &[Option<&VisibleFunctionTable>],
|
|
first: u32,
|
|
) -> Result<(), Error> {
|
|
self.log(|_| {
|
|
RenderCall::FunctionTables(
|
|
Table::Fragment,
|
|
tables.iter().map(|t| t.cloned()).collect(),
|
|
first,
|
|
)
|
|
});
|
|
const CALL: &str = "set_fragment_visible_function_tables";
|
|
self.fragment
|
|
.set_function_tables(&mut self.core, CALL, tables, first)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::set_tile_visible_function_table`].
|
|
pub(crate) fn set_tile_visible_function_table(
|
|
&mut self,
|
|
table: Option<&VisibleFunctionTable>,
|
|
index: u32,
|
|
) -> Result<(), Error> {
|
|
self.log(|_| RenderCall::FunctionTable(Table::Tile, table.cloned(), index));
|
|
const CALL: &str = "set_tile_visible_function_table";
|
|
self.tile
|
|
.set_function_tables(&mut self.core, CALL, &[table], index)
|
|
}
|
|
|
|
/// The lowering of [`RenderCommandEncoder::set_tile_visible_function_tables`].
|
|
pub(crate) fn set_tile_visible_function_tables(
|
|
&mut self,
|
|
tables: &[Option<&VisibleFunctionTable>],
|
|
first: u32,
|
|
) -> Result<(), Error> {
|
|
self.log(|_| {
|
|
RenderCall::FunctionTables(
|
|
Table::Tile,
|
|
tables.iter().map(|t| t.cloned()).collect(),
|
|
first,
|
|
)
|
|
});
|
|
const CALL: &str = "set_tile_visible_function_tables";
|
|
self.tile
|
|
.set_function_tables(&mut self.core, CALL, tables, first)
|
|
}
|
|
}
|
|
|
|
impl RenderCommandEncoder {
|
|
/// `setVertexVisibleFunctionTable:atBufferIndex:` (`None` unbinds the index): the table at
|
|
/// the vertex stage's buffer index `index`, in place of any buffer there, as a compute
|
|
/// encoder's `set_visible_function_table` binds one (`function_table.rs`). Refused: an index
|
|
/// past the buffer table, a table of another device. A draw whose vertex function reads a
|
|
/// buffer at the index, or a table where a buffer is bound, is refused
|
|
/// (`Invalid(FunctionTable)`), as Metal's validation stops it.
|
|
pub fn set_vertex_visible_function_table(
|
|
&mut self,
|
|
table: Option<&VisibleFunctionTable>,
|
|
index: u32,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => {
|
|
self.at_call(|lowering| lowering.set_vertex_visible_function_table(table, index))
|
|
}
|
|
false => {
|
|
self.defer(|_| RenderCall::FunctionTable(Table::Vertex, table.cloned(), index))
|
|
}
|
|
}
|
|
}
|
|
|
|
/// `setVertexVisibleFunctionTables:withBufferRange:`: `tables[i]` at the vertex stage's
|
|
/// buffer index `first + i`, refused as
|
|
/// [`set_vertex_visible_function_table`](Self::set_vertex_visible_function_table) is; a
|
|
/// refusal binds none of them.
|
|
pub fn set_vertex_visible_function_tables(
|
|
&mut self,
|
|
tables: &[Option<&VisibleFunctionTable>],
|
|
first: u32,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => {
|
|
self.at_call(|lowering| lowering.set_vertex_visible_function_tables(tables, first))
|
|
}
|
|
false => self.defer(|_| {
|
|
RenderCall::FunctionTables(
|
|
Table::Vertex,
|
|
tables.iter().map(|t| t.cloned()).collect(),
|
|
first,
|
|
)
|
|
}),
|
|
}
|
|
}
|
|
|
|
/// `setFragmentVisibleFunctionTable:atBufferIndex:`: as
|
|
/// [`set_vertex_visible_function_table`](Self::set_vertex_visible_function_table), at the
|
|
/// fragment stage's buffer index.
|
|
pub fn set_fragment_visible_function_table(
|
|
&mut self,
|
|
table: Option<&VisibleFunctionTable>,
|
|
index: u32,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => {
|
|
self.at_call(|lowering| lowering.set_fragment_visible_function_table(table, index))
|
|
}
|
|
false => {
|
|
self.defer(|_| RenderCall::FunctionTable(Table::Fragment, table.cloned(), index))
|
|
}
|
|
}
|
|
}
|
|
|
|
/// `setFragmentVisibleFunctionTables:withBufferRange:`: as
|
|
/// [`set_vertex_visible_function_tables`](Self::set_vertex_visible_function_tables), at the
|
|
/// fragment stage's buffer indices.
|
|
pub fn set_fragment_visible_function_tables(
|
|
&mut self,
|
|
tables: &[Option<&VisibleFunctionTable>],
|
|
first: u32,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => self
|
|
.at_call(|lowering| lowering.set_fragment_visible_function_tables(tables, first)),
|
|
false => self.defer(|_| {
|
|
RenderCall::FunctionTables(
|
|
Table::Fragment,
|
|
tables.iter().map(|t| t.cloned()).collect(),
|
|
first,
|
|
)
|
|
}),
|
|
}
|
|
}
|
|
|
|
/// `setTileVisibleFunctionTable:atBufferIndex:`: as
|
|
/// [`set_vertex_visible_function_table`](Self::set_vertex_visible_function_table), at the
|
|
/// tile stage's buffer index, which tile dispatches read.
|
|
pub fn set_tile_visible_function_table(
|
|
&mut self,
|
|
table: Option<&VisibleFunctionTable>,
|
|
index: u32,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => self.at_call(|lowering| lowering.set_tile_visible_function_table(table, index)),
|
|
false => self.defer(|_| RenderCall::FunctionTable(Table::Tile, table.cloned(), index)),
|
|
}
|
|
}
|
|
|
|
/// `setTileVisibleFunctionTables:withBufferRange:`: as
|
|
/// [`set_vertex_visible_function_tables`](Self::set_vertex_visible_function_tables), at the
|
|
/// tile stage's buffer indices.
|
|
pub fn set_tile_visible_function_tables(
|
|
&mut self,
|
|
tables: &[Option<&VisibleFunctionTable>],
|
|
first: u32,
|
|
) -> Result<(), Error> {
|
|
match self.lowers_at_call() {
|
|
true => {
|
|
self.at_call(|lowering| lowering.set_tile_visible_function_tables(tables, first))
|
|
}
|
|
false => self.defer(|_| {
|
|
RenderCall::FunctionTables(
|
|
Table::Tile,
|
|
tables.iter().map(|t| t.cloned()).collect(),
|
|
first,
|
|
)
|
|
}),
|
|
}
|
|
}
|
|
}
|