RUNTIME 2342, SEMANTICS 2122: Texture buffers read through argument buffers sit in texel-buffer heap classes
A pipeline whose argument buffers hold texture buffers was refused with ArgumentBufferTextures (NotImplemented, no location): the translator's heap layout (lower/texture/slot.rs declare_heap) had no set-1 class for a texture_buffer member, so SPIRV-Cross-shaped tier-2 argument buffers (descriptor sets as [[buffer(n)]] structs with texture_buffer, texture2d and sampler members) could not be made, on any device. - Set 1 gains texel-buffer heap classes: UNIFORM_TEXEL_BUFFER for read, formatless STORAGE_TEXEL_BUFFER for read_write and write. The class follows the facts' texture type. - DescriptorCaps gains update_after_bind_uniform_texel_buffer and update_after_bind_storage_texel_buffer; where a device lacks them a typed needs_any_of names the missing features. Non-uniform texel-buffer indexing and the without-format read/write needs are checked as for images; link counts STORAGE_TEXEL_BUFFER with the images against the update-after-bind limits. - New public bind::heap::HeapElement::TexelBuffer(vk::Format). - The runtime writes each live texture buffer's texel view at its resource ID, with a neutral texel view at element 0; a gone texture buffer's Texels stay alive until its tickets clear. A texture buffer whose bytes cannot be viewed in place (staged, tail-viewed, offset off minTexelBufferOffsetAlignment, past maxTexelBufferElements, swizzled, or a non-direct format) reads the neutral and is announced through the existing UnnamedTextureUnviewable. No new Degradation kind. - docs/REFUSALS.md and api_signatures.tsv regenerated. Test: runtime_lane::argument_texel_buffers::a_texture_buffer_in_an_argument_buffer_is_read_in_both_stages (an owned fixture in SPIRV-Cross's shape): vertex and fragment read a texture_buffer member of a set-0 argument buffer, the fragment also samples a set-1 texture2d through the sampler beside it; every pixel must equal texel[1] + texel[4]*tint + albedo. Verified: lavapipe with the validation layer, m3-max-31658 at 6626eeaff3: pass. Control m3-max-31636 (the fixture and test at the base, without the fix): fails with exactly the ArgumentBufferTextures NotImplemented refusal.
This commit is contained in:
1 parent
f90b069111
commit
ec0be064d0
25 files changed
+1807
-60
No files matched your search
@@ -209,7 +209,9 @@ impl Drop for TexelViews {
|
||||
};
|
||||
let raw = self.device.shared().vk();
|
||||
// SAFETY: no pending command buffer uses a view: a committed command buffer holds every
|
||||
// texture it binds until it completes.
|
||||
// texture it binds until it completes, and a gone texture buffer's texels, whose views a
|
||||
// heap set may hold, wait for every command buffer that may read the set
|
||||
// (`heap_sets::gone`).
|
||||
unsafe {
|
||||
for &view in lock(&self.views).values() {
|
||||
release::object(raw, view);
|
||||
@@ -2590,6 +2592,43 @@ impl Texels {
|
||||
self.view_of(format, storage, (range.offset, range.range))
|
||||
}
|
||||
|
||||
/// The texel buffer view through which a heap set's texel-buffer array holds these texels, a
|
||||
/// texture buffer's, in `format`, a storage texel buffer's (`storage`) or a uniform one's
|
||||
/// (`bind::HeapElement::TexelBuffer`): the view a slot's binding of them takes
|
||||
/// (`bind::instantiate::texel_ranges`), from their offset over the whole texel blocks of
|
||||
/// their length. `None` where no command's binding of them would make such a view in place:
|
||||
/// their bindings view a staging buffer or their tail ([`Texels::staged`]), which only an
|
||||
/// encoder that binds them copies in and back; their offset is off the device's
|
||||
/// `minTexelBufferOffsetAlignment`; their length holds no whole block; or they hold more
|
||||
/// texels than `maxTexelBufferElements`.
|
||||
pub(super) fn heap_view(
|
||||
&self,
|
||||
format: Format,
|
||||
storage: bool,
|
||||
) -> Result<Option<vk::BufferView>, Error> {
|
||||
if self.staged.is_some() {
|
||||
return Ok(None);
|
||||
}
|
||||
let device = self.buffer.generation();
|
||||
let profile = device.compile_device().profile();
|
||||
let limits = profile.limits();
|
||||
let (_, offset) = self.viewed();
|
||||
let block = format
|
||||
.block()
|
||||
.ok_or_else(|| internal("a texel view of a format without a block"))?;
|
||||
let size = u64::from(block.size).max(1);
|
||||
let blocks = self.shader.row_bytes / size;
|
||||
let elements = blocks.saturating_mul(u64::from(block.texels));
|
||||
if offset % limits.min_texel_buffer_offset_alignment.max(1) != 0
|
||||
|| blocks == 0
|
||||
|| elements > u64::from(limits.max_texel_buffer_elements)
|
||||
{
|
||||
return Ok(None);
|
||||
}
|
||||
self.view_of(format, storage, (offset, blocks * size))
|
||||
.map(Some)
|
||||
}
|
||||
|
||||
/// [`view`](Self::view) of `range` bytes from `offset` in the viewed `VkBuffer`.
|
||||
pub(super) fn view_of(
|
||||
&self,
|
||||
|
||||
@@ -1311,7 +1311,12 @@ degradations! {
|
||||
/// A texture that a heap array's class fits, but whose format the array cannot view (one
|
||||
/// the device cannot sample, or store without a format, or one whose raw texels need its
|
||||
/// function's decode): the device's heap set holds the class's neutral at its ID, which a
|
||||
/// command that names the texture refuses instead (`heap_sets.rs`).
|
||||
/// command that names the texture refuses instead (`heap_sets.rs`). A texture buffer a
|
||||
/// texel-buffer class fits that no texel view of its bytes in place reaches (its
|
||||
/// bindings view a staging buffer or its tail, its offset is off
|
||||
/// `minTexelBufferOffsetAlignment`, it holds more texels than `maxTexelBufferElements`),
|
||||
/// or whose swizzle or format a texel view cannot present, is the class's neutral there
|
||||
/// too, whether a command names it or not (`buffer_texture.rs`).
|
||||
UnnamedTextureUnviewable = "unnamed-texture-unviewable", Precision,
|
||||
"a function reading the texture through its ID, in a command that does not name it \
|
||||
(bind it, or make it resident), reads the neutral texture where Metal's reads the \
|
||||
|
||||
@@ -692,7 +692,7 @@ impl DeviceHeaps {
|
||||
.images
|
||||
.iter()
|
||||
.filter(|array| element < array.count)
|
||||
.map(|array| raw_write(array.binding, element, array.ty, image_info(array.neutral)))
|
||||
.map(|array| raw_write(array.binding, element, array.ty, array.neutral))
|
||||
.collect();
|
||||
for version in &open {
|
||||
// SAFETY: no submission of the version's command buffer took it (its flag is set
|
||||
@@ -1258,7 +1258,8 @@ struct ImageArray {
|
||||
class: ImageHandleClass,
|
||||
ty: vk::DescriptorType,
|
||||
count: u32,
|
||||
neutral: vk::ImageView,
|
||||
/// The class's neutral: an image view, or a texel-buffer class's texel buffer view.
|
||||
neutral: Info,
|
||||
/// By resource ID, the shadowed textures whose shadow image's view the array holds, with the
|
||||
/// key a command's uses name each by (`Texture::bound_use`): a command that binds the set
|
||||
/// and neither names one nor makes it resident is announced
|
||||
@@ -1482,9 +1483,10 @@ impl SetEntry {
|
||||
let mut all: Vec<Write> = Vec::new();
|
||||
for array in &self.images {
|
||||
let reach = array.count.min(TABLE_ENTRIES);
|
||||
all.extend((0..reach).map(|element| {
|
||||
raw_write(array.binding, element, array.ty, image_info(array.neutral))
|
||||
}));
|
||||
all.extend(
|
||||
(0..reach)
|
||||
.map(|element| raw_write(array.binding, element, array.ty, array.neutral)),
|
||||
);
|
||||
}
|
||||
for array in &self.samplers {
|
||||
all.extend((0..array.count).map(|element| {
|
||||
@@ -1711,7 +1713,7 @@ fn texture_info(
|
||||
texture: &Texture,
|
||||
notes: &mut Notes,
|
||||
) -> Result<(Info, Option<ResourceKey>, Option<TwinRead>, bool), Error> {
|
||||
let neutral = || Ok((image_info(array.neutral), None, None, false));
|
||||
let neutral = || Ok((array.neutral, None, None, false));
|
||||
let profile = device.compile_device().profile();
|
||||
let class = HandleClass::Image(array.class);
|
||||
let facts = texture.facts();
|
||||
@@ -1722,6 +1724,21 @@ fn texture_info(
|
||||
metal2vulkan::vk::ImageLayout::GENERAL,
|
||||
) {
|
||||
Ok(HeapElement::View(desc)) => desc,
|
||||
// A texture buffer's texel buffer view, over its buffer's bytes in place.
|
||||
Ok(HeapElement::TexelBuffer(format)) => {
|
||||
let storage = array.ty == vk::DescriptorType::STORAGE_TEXEL_BUFFER;
|
||||
let view = match texture.texels() {
|
||||
Some(texels) => texels.heap_view(format, storage)?,
|
||||
None => None,
|
||||
};
|
||||
return match view {
|
||||
Some(view) => Ok((Info::Texel(view), None, None, false)),
|
||||
None => {
|
||||
notes.unviewable(texture);
|
||||
neutral()
|
||||
}
|
||||
};
|
||||
}
|
||||
Ok(_) => return neutral(),
|
||||
Err(BindError::Unsupported(_)) => {
|
||||
notes.unviewable(texture);
|
||||
@@ -2244,7 +2261,13 @@ impl SetEntry {
|
||||
BindingSource::Heap(HandleClass::Image(class)) => {
|
||||
let neutral = NeutralResource::for_image(&class)
|
||||
.ok_or_else(|| internal("a heap array of a class without a neutral"))?;
|
||||
let neutral = device.neutral_view(neutral)?;
|
||||
let neutral = match neutral {
|
||||
NeutralResource::TexelBuffer { format } => {
|
||||
let storage = ty == vk::DescriptorType::STORAGE_TEXEL_BUFFER;
|
||||
Info::Texel(device.neutral_texel_view(format, storage)?)
|
||||
}
|
||||
neutral => image_info(device.neutral_view(neutral)?),
|
||||
};
|
||||
images.push(ImageArray {
|
||||
binding: binding.binding,
|
||||
class,
|
||||
@@ -2255,7 +2278,7 @@ impl SetEntry {
|
||||
twins: BTreeMap::new(),
|
||||
raws: BTreeMap::new(),
|
||||
});
|
||||
image_info(neutral)
|
||||
neutral
|
||||
}
|
||||
BindingSource::Heap(class @ HandleClass::Sampler { compare, .. }) => {
|
||||
let neutral = device.neutral_sampler(compare)?;
|
||||
|
||||
@@ -656,8 +656,9 @@ impl TextureShared {
|
||||
.is_some_and(|image| image.handed_out())
|
||||
}
|
||||
|
||||
/// The device of the texture's parts on their generation, and what keeps their image while a
|
||||
/// command buffer that bound its ID there may read it ([`leave_slot`](Self::leave_slot)).
|
||||
/// The device of the texture's parts on their generation, and what keeps their image (a
|
||||
/// texture buffer's texels, whose views heap sets hold) while a command buffer that bound its
|
||||
/// ID there may read it ([`leave_slot`](Self::leave_slot)).
|
||||
pub(super) fn slot_keeper(&self) -> (&Device, Option<Box<dyn Any + Send + Sync>>) {
|
||||
let storage = match self.storage.stored() {
|
||||
Stored::Made(storage) => storage,
|
||||
@@ -680,7 +681,12 @@ impl TextureShared {
|
||||
};
|
||||
(&image.device, Some(Box::new((Arc::clone(image), moved))))
|
||||
}
|
||||
Storage::Texels(texels) => (texels.generation(), None),
|
||||
// A texture buffer's texel buffer views, which a heap set's texel-buffer arrays hold
|
||||
// (`heap_sets.rs`), and the buffer they view.
|
||||
Storage::Texels(texels) => (
|
||||
texels.generation(),
|
||||
Some(Box::new(Arc::clone(texels)) as Box<dyn Any + Send + Sync>),
|
||||
),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ fixture a27_thread_atomics: metal: Apple metal version 32023.921 (metalfe-32023.
|
||||
fixture a2c_coverage: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture a8r_buffers: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture a8r_targets: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture abt_descriptor_sets: metal: Apple metal version 32023.922 (metalfe-32023.922.4); macosx-sdk: 27.2 (26B118)
|
||||
fixture air_1_11_front_end: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture air_1_8_front_end: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
fixture air_2_1_front_end: metal: Apple metal version 32023.921 (metalfe-32023.921.6); macosx-sdk: 27.0 (26A425)
|
||||
|
||||
@@ -0,0 +1,474 @@
|
||||
; Generated by scripts/regen-air-fixtures from abt_descriptor_sets.metal (typed pointers; xcrun metal-as reassembles it). Do not edit.
|
||||
; ModuleID = '-'
|
||||
source_filename = "-"
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
|
||||
target triple = "air64_v28-apple-macosx26.0.0"
|
||||
|
||||
%struct.spvDescriptorSetBuffer0 = type { %struct.Frame addrspace(2)*, %"struct.metal::depth2d", %"struct.metal::sampler", %"struct.metal::texture_buffer", %"struct.metal::texture_buffer.3" }
|
||||
%struct.Frame = type { <4 x float>, <4 x float> }
|
||||
%"struct.metal::depth2d" = type { %struct._depth_2d_t addrspace(1)* }
|
||||
%struct._depth_2d_t = type opaque
|
||||
%"struct.metal::sampler" = type { %struct._sampler_t addrspace(2)* }
|
||||
%struct._sampler_t = type opaque
|
||||
%"struct.metal::texture_buffer" = type { %struct._texture_buffer_1d_t addrspace(1)* }
|
||||
%struct._texture_buffer_1d_t = type opaque
|
||||
%"struct.metal::texture_buffer.3" = type { %struct._texture_buffer_1d_t addrspace(1)* }
|
||||
%struct.spvDescriptorSetBuffer1 = type { %"struct.metal::texture2d", %"struct.metal::sampler", %"struct.metal::texturecube", %"struct.metal::sampler", %"struct.metal::array", %struct.Material addrspace(1)*, %"struct.metal::texture2d.23" }
|
||||
%"struct.metal::texture2d" = type { %struct._texture_2d_t addrspace(1)* }
|
||||
%struct._texture_2d_t = type opaque
|
||||
%"struct.metal::texturecube" = type { %struct._texture_cube_t addrspace(1)* }
|
||||
%struct._texture_cube_t = type opaque
|
||||
%"struct.metal::array" = type { [8 x %"struct.metal::texture2d"] }
|
||||
%struct.Material = type { <4 x float>, i32, i32, i32, i32 }
|
||||
%"struct.metal::texture2d.23" = type { %struct._texture_2d_t addrspace(1)* }
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
|
||||
define <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> @abt_vert_plain(i32 noundef %0) local_unnamed_addr #0 {
|
||||
%2 = shl i32 %0, 1
|
||||
%3 = and i32 %2, 2
|
||||
%4 = tail call fast float @air.convert.f.f32.u.i32(i32 %3) #7
|
||||
%5 = insertelement <2 x float> undef, float %4, i64 0
|
||||
%6 = and i32 %0, 2
|
||||
%7 = tail call fast float @air.convert.f.f32.u.i32(i32 %6) #7
|
||||
%8 = insertelement <2 x float> %5, float %7, i64 1
|
||||
%9 = fmul fast <2 x float> %8, <float 2.000000e+00, float -2.000000e+00>
|
||||
%10 = fadd fast <2 x float> %9, <float -1.000000e+00, float 1.000000e+00>
|
||||
%11 = shufflevector <2 x float> %10, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
|
||||
%12 = shufflevector <4 x float> %11, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%13 = fmul fast <2 x float> %8, <float 2.000000e+00, float 2.000000e+00>
|
||||
%14 = fadd fast <2 x float> %13, <float -1.000000e+00, float -1.000000e+00>
|
||||
%15 = shufflevector <2 x float> %14, <2 x float> poison, <3 x i32> <i32 0, i32 1, i32 undef>
|
||||
%16 = insertelement <3 x float> %15, float 1.000000e+00, i64 2
|
||||
%17 = shufflevector <2 x float> %8, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
|
||||
%18 = shufflevector <4 x float> %17, <4 x float> <float poison, float poison, float 5.000000e-01, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%19 = and i32 %0, 7
|
||||
%20 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> undef, <4 x float> %12, 0
|
||||
%21 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %20, <2 x float> %8, 1
|
||||
%22 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %21, <3 x float> %16, 2
|
||||
%23 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %22, <4 x float> %18, 3
|
||||
%24 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %23, i32 %19, 4
|
||||
ret <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %24
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> @abt_vert_sets(i32 noundef %0, %struct.spvDescriptorSetBuffer0 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(40) "air-buffer-no-alias" %1) local_unnamed_addr #1 {
|
||||
%3 = shl i32 %0, 1
|
||||
%4 = and i32 %3, 2
|
||||
%5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #7
|
||||
%6 = insertelement <2 x float> undef, float %5, i64 0
|
||||
%7 = and i32 %0, 2
|
||||
%8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #7
|
||||
%9 = insertelement <2 x float> %6, float %8, i64 1
|
||||
%10 = fmul fast <2 x float> %9, <float 2.000000e+00, float -2.000000e+00>
|
||||
%11 = fadd fast <2 x float> %10, <float -1.000000e+00, float 1.000000e+00>
|
||||
%12 = shufflevector <2 x float> %11, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
|
||||
%13 = shufflevector <4 x float> %12, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%14 = fmul fast <2 x float> %9, <float 2.000000e+00, float 2.000000e+00>
|
||||
%15 = fadd fast <2 x float> %14, <float -1.000000e+00, float -1.000000e+00>
|
||||
%16 = shufflevector <2 x float> %15, <2 x float> poison, <3 x i32> <i32 0, i32 1, i32 undef>
|
||||
%17 = insertelement <3 x float> %16, float 1.000000e+00, i64 2
|
||||
%18 = shufflevector <2 x float> %9, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
|
||||
%19 = shufflevector <4 x float> %18, <4 x float> <float poison, float poison, float 5.000000e-01, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%20 = and i32 %0, 7
|
||||
%21 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %1, i64 0, i32 3, i32 0
|
||||
%22 = load %struct._texture_buffer_1d_t addrspace(1)*, %struct._texture_buffer_1d_t addrspace(1)* addrspace(1)* %21, align 8, !tbaa !81, !alias.scope !86
|
||||
%23 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #8
|
||||
%24 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(%struct._texture_buffer_1d_t addrspace(1)* nocapture readonly %22, %struct._sampler_t addrspace(2)* %23, i32 %0, i32 1) #9
|
||||
%25 = extractvalue { <4 x float>, i8 } %24, 0
|
||||
%26 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %1, i64 0, i32 0
|
||||
%27 = load %struct.Frame addrspace(2)*, %struct.Frame addrspace(2)* addrspace(1)* %26, align 8, !tbaa !89, !alias.scope !86
|
||||
%28 = getelementptr inbounds %struct.Frame, %struct.Frame addrspace(2)* %27, i64 0, i32 1
|
||||
%29 = load <4 x float>, <4 x float> addrspace(2)* %28, align 16
|
||||
%30 = fmul fast <4 x float> %29, %25
|
||||
%31 = fadd fast <4 x float> %30, %13
|
||||
%32 = shufflevector <4 x float> %31, <4 x float> %13, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%33 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> undef, <4 x float> %32, 0
|
||||
%34 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %33, <2 x float> %9, 1
|
||||
%35 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %34, <3 x float> %17, 2
|
||||
%36 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %35, <4 x float> %19, 3
|
||||
%37 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %36, i32 %20, 4
|
||||
ret <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %37
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_sample(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, %struct.spvDescriptorSetBuffer1 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(112) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %4, i64 0, i32 1, i32 0
|
||||
%7 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %6, align 8, !tbaa.struct !97, !alias.scope !99
|
||||
%8 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %4, i64 0, i32 0, i32 0
|
||||
%9 = load %struct._texture_2d_t addrspace(1)*, %struct._texture_2d_t addrspace(1)* addrspace(1)* %8, align 8, !tbaa !102, !alias.scope !99
|
||||
%10 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %9, %struct._sampler_t addrspace(2)* nocapture readonly %7, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%11 = extractvalue { <4 x float>, i8 } %10, 0
|
||||
%12 = insertvalue <{ <4 x float> }> undef, <4 x float> %11, 0
|
||||
ret <{ <4 x float> }> %12
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_compare(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, %struct.spvDescriptorSetBuffer0 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(40) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 2, i32 0
|
||||
%7 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %6, align 8, !tbaa.struct !97, !alias.scope !105
|
||||
%8 = shufflevector <4 x float> %2, <4 x float> poison, <2 x i32> <i32 0, i32 1>
|
||||
%9 = extractelement <4 x float> %2, i64 2
|
||||
%10 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 1, i32 0
|
||||
%11 = load %struct._depth_2d_t addrspace(1)*, %struct._depth_2d_t addrspace(1)* addrspace(1)* %10, align 8, !tbaa !108, !alias.scope !105
|
||||
%12 = tail call { float, i8 } @air.sample_compare_depth_2d.f32(%struct._depth_2d_t addrspace(1)* nocapture readonly %11, %struct._sampler_t addrspace(2)* nocapture readonly %7, i32 1, <2 x float> %8, float %9, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%13 = extractvalue { float, i8 } %12, 0
|
||||
%14 = insertelement <4 x float> poison, float %13, i64 0
|
||||
%15 = shufflevector <4 x float> %14, <4 x float> poison, <4 x i32> zeroinitializer
|
||||
%16 = insertvalue <{ <4 x float> }> undef, <4 x float> %15, 0
|
||||
ret <{ <4 x float> }> %16
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_cube(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, %struct.spvDescriptorSetBuffer1 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(112) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %4, i64 0, i32 3, i32 0
|
||||
%7 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %6, align 8, !tbaa.struct !97, !alias.scope !109
|
||||
%8 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %4, i64 0, i32 2, i32 0
|
||||
%9 = load %struct._texture_cube_t addrspace(1)*, %struct._texture_cube_t addrspace(1)* addrspace(1)* %8, align 8, !tbaa !112, !alias.scope !109
|
||||
%10 = tail call { <4 x float>, i8 } @air.sample_texture_cube.v4f32(%struct._texture_cube_t addrspace(1)* nocapture readonly %9, %struct._sampler_t addrspace(2)* nocapture readonly %7, <3 x float> %1, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%11 = extractvalue { <4 x float>, i8 } %10, 0
|
||||
%12 = insertvalue <{ <4 x float> }> undef, <4 x float> %11, 0
|
||||
ret <{ <4 x float> }> %12
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_array(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, %struct.spvDescriptorSetBuffer1 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(112) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = zext i32 %3 to i64
|
||||
%7 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %4, i64 0, i32 1, i32 0
|
||||
%8 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %7, align 8, !tbaa.struct !97, !alias.scope !115
|
||||
%9 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %4, i64 0, i32 4, i32 0, i64 %6, i32 0
|
||||
%10 = load %struct._texture_2d_t addrspace(1)*, %struct._texture_2d_t addrspace(1)* addrspace(1)* %9, align 8, !tbaa !102, !alias.scope !115
|
||||
%11 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %10, %struct._sampler_t addrspace(2)* nocapture readonly %8, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%12 = extractvalue { <4 x float>, i8 } %11, 0
|
||||
%13 = insertvalue <{ <4 x float> }> undef, <4 x float> %12, 0
|
||||
ret <{ <4 x float> }> %13
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_texel_buffer(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, %struct.spvDescriptorSetBuffer0 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(40) "air-buffer-no-alias" %4) local_unnamed_addr #1 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 3, i32 0
|
||||
%7 = load %struct._texture_buffer_1d_t addrspace(1)*, %struct._texture_buffer_1d_t addrspace(1)* addrspace(1)* %6, align 8, !tbaa !81, !alias.scope !118
|
||||
%8 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #8
|
||||
%9 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(%struct._texture_buffer_1d_t addrspace(1)* nocapture readonly %7, %struct._sampler_t addrspace(2)* %8, i32 %3, i32 1) #9
|
||||
%10 = extractvalue { <4 x float>, i8 } %9, 0
|
||||
%11 = insertvalue <{ <4 x float> }> undef, <4 x float> %10, 0
|
||||
ret <{ <4 x float> }> %11
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_storage(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, <4 x float> noundef %4, %struct.spvDescriptorSetBuffer1 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(112) "air-buffer-no-alias" %5) local_unnamed_addr #1 {
|
||||
%7 = shufflevector <4 x float> %4, <4 x float> poison, <2 x i32> <i32 0, i32 1>
|
||||
%8 = tail call <2 x i32> @air.convert.u.v2i32.f.v2f32(<2 x float> %7) #7
|
||||
%9 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 6, i32 0
|
||||
%10 = load %struct._texture_2d_t addrspace(1)*, %struct._texture_2d_t addrspace(1)* addrspace(1)* %9, align 8, !tbaa !121, !alias.scope !123
|
||||
%11 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #8
|
||||
%12 = tail call { <4 x float>, i8 } @air.read_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %10, %struct._sampler_t addrspace(2)* %11, <2 x i32> %8, <2 x i32> zeroinitializer, i32 0, i32 3) #9
|
||||
%13 = extractvalue { <4 x float>, i8 } %12, 0
|
||||
%14 = insertvalue <{ <4 x float> }> undef, <4 x float> %13, 0
|
||||
ret <{ <4 x float> }> %14
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
|
||||
declare <2 x i32> @air.convert.u.v2i32.f.v2f32(<2 x float>) local_unnamed_addr #3
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_sets(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, %struct.spvDescriptorSetBuffer0 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(40) "air-buffer-no-alias" %4, %struct.spvDescriptorSetBuffer1 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(112) "air-buffer-no-alias" %5) local_unnamed_addr #2 {
|
||||
%7 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 5
|
||||
%8 = load %struct.Material addrspace(1)*, %struct.Material addrspace(1)* addrspace(1)* %7, align 8, !tbaa !126, !alias.scope !129, !noalias !132
|
||||
%9 = zext i32 %3 to i64
|
||||
%10 = getelementptr inbounds %struct.Material, %struct.Material addrspace(1)* %8, i64 %9, i32 0
|
||||
%11 = load <4 x float>, <4 x float> addrspace(1)* %10, align 16, !tbaa.struct !134
|
||||
%12 = getelementptr inbounds %struct.Material, %struct.Material addrspace(1)* %8, i64 %9, i32 1
|
||||
%13 = load i32, i32 addrspace(1)* %12, align 16, !tbaa.struct !138
|
||||
%14 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 1, i32 0
|
||||
%15 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %14, align 8, !alias.scope !129, !noalias !132
|
||||
%16 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 0, i32 0
|
||||
%17 = load %struct._texture_2d_t addrspace(1)*, %struct._texture_2d_t addrspace(1)* addrspace(1)* %16, align 8, !tbaa !102, !alias.scope !129, !noalias !132
|
||||
%18 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %17, %struct._sampler_t addrspace(2)* nocapture readonly %15, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%19 = extractvalue { <4 x float>, i8 } %18, 0
|
||||
%20 = zext i32 %13 to i64
|
||||
%21 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 4, i32 0, i64 %20, i32 0
|
||||
%22 = load %struct._texture_2d_t addrspace(1)*, %struct._texture_2d_t addrspace(1)* addrspace(1)* %21, align 8, !tbaa !102, !alias.scope !129, !noalias !132
|
||||
%23 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %22, %struct._sampler_t addrspace(2)* nocapture readonly %15, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%24 = extractvalue { <4 x float>, i8 } %23, 0
|
||||
%25 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 3, i32 0
|
||||
%26 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %25, align 8, !tbaa.struct !97, !alias.scope !129, !noalias !132
|
||||
%27 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %5, i64 0, i32 2, i32 0
|
||||
%28 = load %struct._texture_cube_t addrspace(1)*, %struct._texture_cube_t addrspace(1)* addrspace(1)* %27, align 8, !tbaa !112, !alias.scope !129, !noalias !132
|
||||
%29 = tail call { <4 x float>, i8 } @air.sample_texture_cube.v4f32(%struct._texture_cube_t addrspace(1)* nocapture readonly %28, %struct._sampler_t addrspace(2)* nocapture readonly %26, <3 x float> %1, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%30 = extractvalue { <4 x float>, i8 } %29, 0
|
||||
%31 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 2, i32 0
|
||||
%32 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %31, align 8, !tbaa.struct !97, !alias.scope !132, !noalias !129
|
||||
%33 = shufflevector <4 x float> %2, <4 x float> poison, <2 x i32> <i32 0, i32 1>
|
||||
%34 = extractelement <4 x float> %2, i64 2
|
||||
%35 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 1, i32 0
|
||||
%36 = load %struct._depth_2d_t addrspace(1)*, %struct._depth_2d_t addrspace(1)* addrspace(1)* %35, align 8, !tbaa !108, !alias.scope !132, !noalias !129
|
||||
%37 = tail call { float, i8 } @air.sample_compare_depth_2d.f32(%struct._depth_2d_t addrspace(1)* nocapture readonly %36, %struct._sampler_t addrspace(2)* nocapture readonly %32, i32 1, <2 x float> %33, float %34, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%38 = extractvalue { float, i8 } %37, 0
|
||||
%39 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 3, i32 0
|
||||
%40 = load %struct._texture_buffer_1d_t addrspace(1)*, %struct._texture_buffer_1d_t addrspace(1)* addrspace(1)* %39, align 8, !tbaa !81, !alias.scope !132, !noalias !129
|
||||
%41 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #8
|
||||
%42 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(%struct._texture_buffer_1d_t addrspace(1)* nocapture readonly %40, %struct._sampler_t addrspace(2)* %41, i32 %3, i32 1) #9
|
||||
%43 = extractvalue { <4 x float>, i8 } %42, 0
|
||||
%44 = insertelement <4 x float> poison, float %38, i64 0
|
||||
%45 = shufflevector <4 x float> %44, <4 x float> poison, <4 x i32> zeroinitializer
|
||||
%46 = fmul fast <4 x float> %45, %19
|
||||
%47 = fadd fast <4 x float> %30, %24
|
||||
%48 = fadd fast <4 x float> %47, %46
|
||||
%49 = fadd fast <4 x float> %48, %43
|
||||
%50 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %4, i64 0, i32 0
|
||||
%51 = load %struct.Frame addrspace(2)*, %struct.Frame addrspace(2)* addrspace(1)* %50, align 8, !tbaa !89, !alias.scope !132, !noalias !129
|
||||
%52 = getelementptr inbounds %struct.Frame, %struct.Frame addrspace(2)* %51, i64 0, i32 0
|
||||
%53 = load <4 x float>, <4 x float> addrspace(2)* %52, align 16, !tbaa !135
|
||||
%54 = fmul fast <4 x float> %53, %11
|
||||
%55 = fmul fast <4 x float> %54, %49
|
||||
%56 = insertvalue <{ <4 x float> }> undef, <4 x float> %55, 0
|
||||
ret <{ <4 x float> }> %56
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float>, <4 x float>, i32 }> @abt_vert_bones(i32 noundef %0, %struct.spvDescriptorSetBuffer0 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(40) "air-buffer-no-alias" %1) local_unnamed_addr #1 {
|
||||
%3 = shl i32 %0, 1
|
||||
%4 = and i32 %3, 2
|
||||
%5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #7
|
||||
%6 = insertelement <2 x float> undef, float %5, i64 0
|
||||
%7 = and i32 %0, 2
|
||||
%8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #7
|
||||
%9 = insertelement <2 x float> %6, float %8, i64 1
|
||||
%10 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %1, i64 0, i32 0
|
||||
%11 = load %struct.Frame addrspace(2)*, %struct.Frame addrspace(2)* addrspace(1)* %10, align 8, !tbaa !89, !alias.scope !139
|
||||
%12 = getelementptr inbounds %struct.Frame, %struct.Frame addrspace(2)* %11, i64 0, i32 1
|
||||
%13 = load <4 x float>, <4 x float> addrspace(2)* %12, align 16
|
||||
%14 = extractelement <4 x float> %13, i64 0
|
||||
%15 = tail call i32 @air.convert.u.i32.f.f32(float %14) #7
|
||||
%16 = fmul fast <2 x float> %9, <float 2.000000e+00, float -2.000000e+00>
|
||||
%17 = fadd fast <2 x float> %16, <float -1.000000e+00, float 1.000000e+00>
|
||||
%18 = shufflevector <2 x float> %17, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
|
||||
%19 = shufflevector <4 x float> %18, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%20 = add i32 %15, %0
|
||||
%21 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %1, i64 0, i32 3, i32 0
|
||||
%22 = load %struct._texture_buffer_1d_t addrspace(1)*, %struct._texture_buffer_1d_t addrspace(1)* addrspace(1)* %21, align 8, !tbaa !81, !alias.scope !139
|
||||
%23 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #8
|
||||
%24 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(%struct._texture_buffer_1d_t addrspace(1)* nocapture readonly %22, %struct._sampler_t addrspace(2)* %23, i32 %20, i32 1) #9
|
||||
%25 = extractvalue { <4 x float>, i8 } %24, 0
|
||||
%26 = add i32 %20, 3
|
||||
%27 = insertvalue <{ <4 x float>, <4 x float>, i32 }> undef, <4 x float> %19, 0
|
||||
%28 = insertvalue <{ <4 x float>, <4 x float>, i32 }> %27, <4 x float> %25, 1
|
||||
%29 = insertvalue <{ <4 x float>, <4 x float>, i32 }> %28, i32 %26, 2
|
||||
ret <{ <4 x float>, <4 x float>, i32 }> %29
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
|
||||
declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #3
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind readnone willreturn
|
||||
declare i32 @air.convert.u.i32.f.f32(float) local_unnamed_addr #3
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind readonly willreturn
|
||||
define <{ <4 x float> }> @abt_frag_bones(<4 x float> %0, i32 %1, %struct.spvDescriptorSetBuffer0 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(40) "air-buffer-no-alias" %2, %struct.spvDescriptorSetBuffer1 addrspace(1)* nocapture noundef readonly align 8 dereferenceable(112) "air-buffer-no-alias" %3) local_unnamed_addr #2 {
|
||||
%5 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %2, i64 0, i32 3, i32 0
|
||||
%6 = load %struct._texture_buffer_1d_t addrspace(1)*, %struct._texture_buffer_1d_t addrspace(1)* addrspace(1)* %5, align 8, !tbaa !81, !alias.scope !142, !noalias !145
|
||||
%7 = tail call %struct._sampler_t addrspace(2)* @air.get_read_sampler() #8
|
||||
%8 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(%struct._texture_buffer_1d_t addrspace(1)* nocapture readonly %6, %struct._sampler_t addrspace(2)* %7, i32 %1, i32 1) #9
|
||||
%9 = extractvalue { <4 x float>, i8 } %8, 0
|
||||
%10 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %3, i64 0, i32 1, i32 0
|
||||
%11 = load %struct._sampler_t addrspace(2)*, %struct._sampler_t addrspace(2)* addrspace(1)* %10, align 8, !tbaa.struct !97, !alias.scope !145, !noalias !142
|
||||
%12 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, %struct.spvDescriptorSetBuffer1 addrspace(1)* %3, i64 0, i32 0, i32 0
|
||||
%13 = load %struct._texture_2d_t addrspace(1)*, %struct._texture_2d_t addrspace(1)* addrspace(1)* %12, align 8, !tbaa !102, !alias.scope !145, !noalias !142
|
||||
%14 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly %13, %struct._sampler_t addrspace(2)* nocapture readonly %11, <2 x float> <float 5.000000e-01, float 5.000000e-01>, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%15 = extractvalue { <4 x float>, i8 } %14, 0
|
||||
%16 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, %struct.spvDescriptorSetBuffer0 addrspace(1)* %2, i64 0, i32 0
|
||||
%17 = load %struct.Frame addrspace(2)*, %struct.Frame addrspace(2)* addrspace(1)* %16, align 8, !tbaa !89, !alias.scope !142, !noalias !145
|
||||
%18 = getelementptr inbounds %struct.Frame, %struct.Frame addrspace(2)* %17, i64 0, i32 0
|
||||
%19 = load <4 x float>, <4 x float> addrspace(2)* %18, align 16, !tbaa !135
|
||||
%20 = fmul fast <4 x float> %19, %9
|
||||
%21 = fadd fast <4 x float> %15, %0
|
||||
%22 = fadd fast <4 x float> %21, %20
|
||||
%23 = insertvalue <{ <4 x float> }> undef, <4 x float> %22, 0
|
||||
ret <{ <4 x float> }> %23
|
||||
}
|
||||
|
||||
; Function Attrs: inaccessiblememonly mustprogress nofree nounwind readonly willreturn
|
||||
declare %struct._sampler_t addrspace(2)* @air.get_read_sampler() local_unnamed_addr #4
|
||||
|
||||
; Function Attrs: argmemonly mustprogress nofree nounwind readonly willreturn
|
||||
declare { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(%struct._texture_buffer_1d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)*, i32, i32) local_unnamed_addr #5
|
||||
|
||||
; Function Attrs: argmemonly convergent mustprogress nofree nounwind readonly willreturn
|
||||
declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)* nocapture readonly, <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #6
|
||||
|
||||
; Function Attrs: argmemonly convergent mustprogress nofree nounwind readonly willreturn
|
||||
declare { float, i8 } @air.sample_compare_depth_2d.f32(%struct._depth_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)* nocapture readonly, i32, <2 x float>, float, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #6
|
||||
|
||||
; Function Attrs: argmemonly convergent mustprogress nofree nounwind readonly willreturn
|
||||
declare { <4 x float>, i8 } @air.sample_texture_cube.v4f32(%struct._texture_cube_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)* nocapture readonly, <3 x float>, i1, float, float, i32) local_unnamed_addr #6
|
||||
|
||||
; Function Attrs: argmemonly mustprogress nofree nounwind readonly willreturn
|
||||
declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(%struct._texture_2d_t addrspace(1)* nocapture readonly, %struct._sampler_t addrspace(2)*, <2 x i32>, <2 x i32>, i32, i32) local_unnamed_addr #5
|
||||
|
||||
attributes #0 = { mustprogress nofree nosync nounwind readnone willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #1 = { mustprogress nofree nounwind readonly willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #2 = { convergent mustprogress nofree nounwind readonly willreturn "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #3 = { mustprogress nofree nosync nounwind readnone willreturn }
|
||||
attributes #4 = { inaccessiblememonly mustprogress nofree nounwind readonly willreturn }
|
||||
attributes #5 = { argmemonly mustprogress nofree nounwind readonly willreturn }
|
||||
attributes #6 = { argmemonly convergent mustprogress nofree nounwind readonly willreturn }
|
||||
attributes #7 = { nounwind readnone willreturn }
|
||||
attributes #8 = { inaccessiblememonly nounwind readonly willreturn }
|
||||
attributes #9 = { argmemonly nounwind readonly willreturn }
|
||||
attributes #10 = { argmemonly convergent nounwind readonly willreturn }
|
||||
|
||||
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
|
||||
!air.vertex = !{!9, !18, !28}
|
||||
!air.fragment = !{!32, !50, !55, !58, !61, !63, !67, !69}
|
||||
!air.compile_options = !{!75, !76, !77}
|
||||
!llvm.ident = !{!78}
|
||||
!air.version = !{!79}
|
||||
!air.language_version = !{!80}
|
||||
|
||||
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]}
|
||||
!1 = !{i32 1, !"wchar_size", i32 4}
|
||||
!2 = !{i32 7, !"frame-pointer", i32 2}
|
||||
!3 = !{i32 7, !"air.max_device_buffers", i32 31}
|
||||
!4 = !{i32 7, !"air.max_constant_buffers", i32 31}
|
||||
!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31}
|
||||
!6 = !{i32 7, !"air.max_textures", i32 128}
|
||||
!7 = !{i32 7, !"air.max_read_write_textures", i32 8}
|
||||
!8 = !{i32 7, !"air.max_samplers", i32 16}
|
||||
!9 = !{<{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> (i32)* @abt_vert_plain, !10, !16}
|
||||
!10 = !{!11, !12, !13, !14, !15}
|
||||
!11 = !{!"air.position", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"}
|
||||
!12 = !{!"air.vertex_output", !"user(locn0)", !"air.arg_type_name", !"float2", !"air.arg_name", !"uv"}
|
||||
!13 = !{!"air.vertex_output", !"user(locn1)", !"air.arg_type_name", !"float3", !"air.arg_name", !"dir"}
|
||||
!14 = !{!"air.vertex_output", !"user(locn2)", !"air.arg_type_name", !"float4", !"air.arg_name", !"shadow"}
|
||||
!15 = !{!"air.vertex_output", !"user(locn3)", !"air.arg_type_name", !"uint", !"air.arg_name", !"layer"}
|
||||
!16 = !{!17}
|
||||
!17 = !{i32 0, !"air.vertex_id", !"air.arg_type_name", !"uint", !"air.arg_name", !"vid"}
|
||||
!18 = !{<{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> (i32, %struct.spvDescriptorSetBuffer0 addrspace(1)*)* @abt_vert_sets, !10, !19}
|
||||
!19 = !{!17, !20}
|
||||
!20 = !{i32 1, !"air.indirect_buffer", !"air.buffer_size", i32 40, !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !21, !"air.arg_type_size", i32 40, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer0", !"air.arg_name", !"spvDescriptorSet0"}
|
||||
!21 = !{i32 0, i32 8, i32 0, !"Frame", !"m_frame", !"air.indirect_argument", !22, i32 8, i32 8, i32 0, !"depth2d<float, sample>", !"shadowMap", !"air.indirect_argument", !24, i32 16, i32 8, i32 0, !"sampler", !"shadowMapSmplr", !"air.indirect_argument", !25, i32 24, i32 8, i32 0, !"texture_buffer<float, read>", !"bones", !"air.indirect_argument", !26, i32 32, i32 8, i32 0, !"texture_buffer<float, read_write>", !"_m4_pad", !"air.indirect_argument", !27}
|
||||
!22 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 2, !"air.struct_type_info", !23, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"Frame", !"air.arg_name", !"m_frame"}
|
||||
!23 = !{i32 0, i32 16, i32 0, !"float4", !"tint", i32 16, i32 16, i32 0, !"float4", !"offset"}
|
||||
!24 = !{i32 1, !"air.texture", !"air.location_index", i32 1, i32 1, !"air.sample", !"air.arg_type_name", !"depth2d<float, sample>", !"air.arg_name", !"shadowMap"}
|
||||
!25 = !{i32 2, !"air.sampler", !"air.location_index", i32 2, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"shadowMapSmplr"}
|
||||
!26 = !{i32 3, !"air.texture", !"air.location_index", i32 3, i32 1, !"air.read", !"air.arg_type_name", !"texture_buffer<float, read>", !"air.arg_name", !"bones"}
|
||||
!27 = !{i32 4, !"air.texture", !"air.location_index", i32 4, i32 1, !"air.read_write", !"air.arg_type_name", !"texture_buffer<float, read_write>", !"air.arg_name", !"_m4_pad"}
|
||||
!28 = !{<{ <4 x float>, <4 x float>, i32 }> (i32, %struct.spvDescriptorSetBuffer0 addrspace(1)*)* @abt_vert_bones, !29, !19}
|
||||
!29 = !{!11, !30, !31}
|
||||
!30 = !{!"air.vertex_output", !"user(locn0)", !"air.arg_type_name", !"float4", !"air.arg_name", !"bone"}
|
||||
!31 = !{!"air.vertex_output", !"user(locn1)", !"air.arg_type_name", !"uint", !"air.arg_name", !"index"}
|
||||
!32 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, %struct.spvDescriptorSetBuffer1 addrspace(1)*)* @abt_frag_sample, !33, !35}
|
||||
!33 = !{!34}
|
||||
!34 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"}
|
||||
!35 = !{!36, !37, !38, !39, !40}
|
||||
!36 = !{i32 0, !"air.fragment_input", !"user(locn0)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float2", !"air.arg_name", !"uv"}
|
||||
!37 = !{i32 1, !"air.fragment_input", !"user(locn1)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float3", !"air.arg_name", !"dir", !"air.arg_unused"}
|
||||
!38 = !{i32 2, !"air.fragment_input", !"user(locn2)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"shadow", !"air.arg_unused"}
|
||||
!39 = !{i32 3, !"air.fragment_input", !"user(locn3)", !"air.flat", !"air.arg_type_name", !"uint", !"air.arg_name", !"layer", !"air.arg_unused"}
|
||||
!40 = !{i32 4, !"air.indirect_buffer", !"air.buffer_size", i32 112, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !41, !"air.arg_type_size", i32 112, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer1", !"air.arg_name", !"spvDescriptorSet1"}
|
||||
!41 = !{i32 0, i32 8, i32 0, !"texture2d<float, sample>", !"albedo", !"air.indirect_argument", !42, i32 8, i32 8, i32 0, !"sampler", !"linearSmplr", !"air.indirect_argument", !43, i32 16, i32 8, i32 0, !"texturecube<float, sample>", !"env", !"air.indirect_argument", !44, i32 24, i32 8, i32 0, !"sampler", !"envSmplr", !"air.indirect_argument", !45, i32 32, i32 64, i32 0, !"array<texture2d<float, sample>, 8>", !"layers", !"air.indirect_argument", !46, i32 96, i32 8, i32 0, !"Material", !"materials", !"air.indirect_argument", !47, i32 104, i32 8, i32 0, !"texture2d<float, read_write>", !"scratch", !"air.indirect_argument", !49}
|
||||
!42 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.sample", !"air.arg_type_name", !"texture2d<float, sample>", !"air.arg_name", !"albedo"}
|
||||
!43 = !{i32 1, !"air.sampler", !"air.location_index", i32 1, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"linearSmplr"}
|
||||
!44 = !{i32 2, !"air.texture", !"air.location_index", i32 2, i32 1, !"air.sample", !"air.arg_type_name", !"texturecube<float, sample>", !"air.arg_name", !"env"}
|
||||
!45 = !{i32 3, !"air.sampler", !"air.location_index", i32 3, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"envSmplr"}
|
||||
!46 = !{i32 4, !"air.texture", !"air.location_index", i32 4, i32 8, !"air.sample", !"air.arg_type_name", !"array<texture2d<float, sample>, 8>", !"air.arg_name", !"layers"}
|
||||
!47 = !{i32 5, !"air.buffer", !"air.location_index", i32 12, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !48, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"Material", !"air.arg_name", !"materials"}
|
||||
!48 = !{i32 0, i32 16, i32 0, !"float4", !"scale", i32 16, i32 4, i32 0, !"uint", !"layer", i32 20, i32 4, i32 0, !"uint", !"pad0", i32 24, i32 4, i32 0, !"uint", !"pad1", i32 28, i32 4, i32 0, !"uint", !"pad2"}
|
||||
!49 = !{i32 6, !"air.texture", !"air.location_index", i32 13, i32 1, !"air.read_write", !"air.arg_type_name", !"texture2d<float, read_write>", !"air.arg_name", !"scratch"}
|
||||
!50 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, %struct.spvDescriptorSetBuffer0 addrspace(1)*)* @abt_frag_compare, !33, !51}
|
||||
!51 = !{!52, !37, !53, !39, !54}
|
||||
!52 = !{i32 0, !"air.fragment_input", !"user(locn0)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float2", !"air.arg_name", !"uv", !"air.arg_unused"}
|
||||
!53 = !{i32 2, !"air.fragment_input", !"user(locn2)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"shadow"}
|
||||
!54 = !{i32 4, !"air.indirect_buffer", !"air.buffer_size", i32 40, !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !21, !"air.arg_type_size", i32 40, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer0", !"air.arg_name", !"spvDescriptorSet0"}
|
||||
!55 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, %struct.spvDescriptorSetBuffer1 addrspace(1)*)* @abt_frag_cube, !33, !56}
|
||||
!56 = !{!52, !57, !38, !39, !40}
|
||||
!57 = !{i32 1, !"air.fragment_input", !"user(locn1)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float3", !"air.arg_name", !"dir"}
|
||||
!58 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, %struct.spvDescriptorSetBuffer1 addrspace(1)*)* @abt_frag_array, !33, !59}
|
||||
!59 = !{!36, !37, !38, !60, !40}
|
||||
!60 = !{i32 3, !"air.fragment_input", !"user(locn3)", !"air.flat", !"air.arg_type_name", !"uint", !"air.arg_name", !"layer"}
|
||||
!61 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, %struct.spvDescriptorSetBuffer0 addrspace(1)*)* @abt_frag_texel_buffer, !33, !62}
|
||||
!62 = !{!52, !37, !38, !60, !54}
|
||||
!63 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, <4 x float>, %struct.spvDescriptorSetBuffer1 addrspace(1)*)* @abt_frag_storage, !33, !64}
|
||||
!64 = !{!52, !37, !38, !39, !65, !66}
|
||||
!65 = !{i32 4, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"pos"}
|
||||
!66 = !{i32 5, !"air.indirect_buffer", !"air.buffer_size", i32 112, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !41, !"air.arg_type_size", i32 112, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer1", !"air.arg_name", !"spvDescriptorSet1"}
|
||||
!67 = !{<{ <4 x float> }> (<2 x float>, <3 x float>, <4 x float>, i32, %struct.spvDescriptorSetBuffer0 addrspace(1)*, %struct.spvDescriptorSetBuffer1 addrspace(1)*)* @abt_frag_sets, !33, !68}
|
||||
!68 = !{!36, !57, !53, !60, !54, !66}
|
||||
!69 = !{<{ <4 x float> }> (<4 x float>, i32, %struct.spvDescriptorSetBuffer0 addrspace(1)*, %struct.spvDescriptorSetBuffer1 addrspace(1)*)* @abt_frag_bones, !33, !70}
|
||||
!70 = !{!71, !72, !73, !74}
|
||||
!71 = !{i32 0, !"air.fragment_input", !"user(locn0)", !"air.flat", !"air.arg_type_name", !"float4", !"air.arg_name", !"bone"}
|
||||
!72 = !{i32 1, !"air.fragment_input", !"user(locn1)", !"air.flat", !"air.arg_type_name", !"uint", !"air.arg_name", !"index"}
|
||||
!73 = !{i32 2, !"air.indirect_buffer", !"air.buffer_size", i32 40, !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !21, !"air.arg_type_size", i32 40, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer0", !"air.arg_name", !"spvDescriptorSet0"}
|
||||
!74 = !{i32 3, !"air.indirect_buffer", !"air.buffer_size", i32 112, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !41, !"air.arg_type_size", i32 112, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer1", !"air.arg_name", !"spvDescriptorSet1"}
|
||||
!75 = !{!"air.compile.denorms_disable"}
|
||||
!76 = !{!"air.compile.fast_math_enable"}
|
||||
!77 = !{!"air.compile.framebuffer_fetch_enable"}
|
||||
!78 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"}
|
||||
!79 = !{i32 2, i32 8, i32 0}
|
||||
!80 = !{!"Metal", i32 4, i32 0, i32 0}
|
||||
!81 = !{!82, !83, i64 0}
|
||||
!82 = !{!"_ZTSN5metal14texture_bufferIfLNS_6accessE1ELNS_16memory_coherenceE0EvEE", !83, i64 0}
|
||||
!83 = !{!"__metal_texture_buffer_1d_t", !84, i64 0}
|
||||
!84 = !{!"omnipotent char", !85, i64 0}
|
||||
!85 = !{!"Simple C++ TBAA"}
|
||||
!86 = !{!87}
|
||||
!87 = distinct !{!87, !88, !"air-alias-scope-arg(1)"}
|
||||
!88 = distinct !{!88, !"air-alias-scopes(abt_vert_sets)"}
|
||||
!89 = !{!90, !91, i64 0}
|
||||
!90 = !{!"_ZTS23spvDescriptorSetBuffer0", !91, i64 0, !92, i64 8, !94, i64 16, !82, i64 24, !96, i64 32}
|
||||
!91 = !{!"any pointer", !84, i64 0}
|
||||
!92 = !{!"_ZTSN5metal7depth2dIfLNS_6accessE0ELNS_16memory_coherenceE0EvEE", !93, i64 0}
|
||||
!93 = !{!"__metal_depth_2d_t", !84, i64 0}
|
||||
!94 = !{!"_ZTSN5metal7samplerE", !95, i64 0}
|
||||
!95 = !{!"__metal_sampler_t", !84, i64 0}
|
||||
!96 = !{!"_ZTSN5metal14texture_bufferIfLNS_6accessE3ELNS_16memory_coherenceE0EvEE", !83, i64 0}
|
||||
!97 = !{i64 0, i64 8, !98}
|
||||
!98 = !{!95, !95, i64 0}
|
||||
!99 = !{!100}
|
||||
!100 = distinct !{!100, !101, !"air-alias-scope-arg(4)"}
|
||||
!101 = distinct !{!101, !"air-alias-scopes(abt_frag_sample)"}
|
||||
!102 = !{!103, !104, i64 0}
|
||||
!103 = !{!"_ZTSN5metal9texture2dIfLNS_6accessE0ELNS_16memory_coherenceE0EvEE", !104, i64 0}
|
||||
!104 = !{!"__metal_texture_2d_t", !84, i64 0}
|
||||
!105 = !{!106}
|
||||
!106 = distinct !{!106, !107, !"air-alias-scope-arg(4)"}
|
||||
!107 = distinct !{!107, !"air-alias-scopes(abt_frag_compare)"}
|
||||
!108 = !{!92, !93, i64 0}
|
||||
!109 = !{!110}
|
||||
!110 = distinct !{!110, !111, !"air-alias-scope-arg(4)"}
|
||||
!111 = distinct !{!111, !"air-alias-scopes(abt_frag_cube)"}
|
||||
!112 = !{!113, !114, i64 0}
|
||||
!113 = !{!"_ZTSN5metal11texturecubeIfLNS_6accessE0ELNS_16memory_coherenceE0EvEE", !114, i64 0}
|
||||
!114 = !{!"__metal_texture_cube_t", !84, i64 0}
|
||||
!115 = !{!116}
|
||||
!116 = distinct !{!116, !117, !"air-alias-scope-arg(4)"}
|
||||
!117 = distinct !{!117, !"air-alias-scopes(abt_frag_array)"}
|
||||
!118 = !{!119}
|
||||
!119 = distinct !{!119, !120, !"air-alias-scope-arg(4)"}
|
||||
!120 = distinct !{!120, !"air-alias-scopes(abt_frag_texel_buffer)"}
|
||||
!121 = !{!122, !104, i64 0}
|
||||
!122 = !{!"_ZTSN5metal9texture2dIfLNS_6accessE3ELNS_16memory_coherenceE0EvEE", !104, i64 0}
|
||||
!123 = !{!124}
|
||||
!124 = distinct !{!124, !125, !"air-alias-scope-arg(5)"}
|
||||
!125 = distinct !{!125, !"air-alias-scopes(abt_frag_storage)"}
|
||||
!126 = !{!127, !91, i64 96}
|
||||
!127 = !{!"_ZTS23spvDescriptorSetBuffer1", !103, i64 0, !94, i64 8, !113, i64 16, !94, i64 24, !128, i64 32, !91, i64 96, !122, i64 104}
|
||||
!128 = !{!"_ZTSN5metal5arrayINS_9texture2dIfLNS_6accessE0ELNS_16memory_coherenceE0EvEELm8EEE", !84, i64 0}
|
||||
!129 = !{!130}
|
||||
!130 = distinct !{!130, !131, !"air-alias-scope-arg(5)"}
|
||||
!131 = distinct !{!131, !"air-alias-scopes(abt_frag_sets)"}
|
||||
!132 = !{!133}
|
||||
!133 = distinct !{!133, !131, !"air-alias-scope-arg(4)"}
|
||||
!134 = !{i64 0, i64 16, !135, i64 16, i64 4, !136, i64 20, i64 4, !136, i64 24, i64 4, !136, i64 28, i64 4, !136}
|
||||
!135 = !{!84, !84, i64 0}
|
||||
!136 = !{!137, !137, i64 0}
|
||||
!137 = !{!"int", !84, i64 0}
|
||||
!138 = !{i64 0, i64 4, !136, i64 4, i64 4, !136, i64 8, i64 4, !136, i64 12, i64 4, !136}
|
||||
!139 = !{!140}
|
||||
!140 = distinct !{!140, !141, !"air-alias-scope-arg(1)"}
|
||||
!141 = distinct !{!141, !"air-alias-scopes(abt_vert_bones)"}
|
||||
!142 = !{!143}
|
||||
!143 = distinct !{!143, !144, !"air-alias-scope-arg(2)"}
|
||||
!144 = distinct !{!144, !"air-alias-scopes(abt_frag_bones)"}
|
||||
!145 = !{!146}
|
||||
!146 = distinct !{!146, !144, !"air-alias-scope-arg(3)"}
|
||||
@@ -0,0 +1,469 @@
|
||||
; Generated by scripts/regen-air-fixtures from abt_descriptor_sets.metal (llvm-dis of abt_descriptor_sets.air). Do not edit.
|
||||
; ModuleID = '<stdin>'
|
||||
source_filename = "-"
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v16:16:16-v24:32:32-v32:32:32-v48:64:64-v64:64:64-v96:128:128-v128:128:128-v192:256:256-v256:256:256-v512:512:512-v1024:1024:1024-n8:16:32"
|
||||
target triple = "air64_v28-apple-macosx26.0.0"
|
||||
|
||||
%struct.spvDescriptorSetBuffer0 = type { ptr addrspace(2), %"struct.metal::depth2d", %"struct.metal::sampler", %"struct.metal::texture_buffer", %"struct.metal::texture_buffer.3" }
|
||||
%"struct.metal::depth2d" = type { ptr addrspace(1) }
|
||||
%"struct.metal::sampler" = type { ptr addrspace(2) }
|
||||
%"struct.metal::texture_buffer" = type { ptr addrspace(1) }
|
||||
%"struct.metal::texture_buffer.3" = type { ptr addrspace(1) }
|
||||
%struct.Frame = type { <4 x float>, <4 x float> }
|
||||
%struct.spvDescriptorSetBuffer1 = type { %"struct.metal::texture2d", %"struct.metal::sampler", %"struct.metal::texturecube", %"struct.metal::sampler", %"struct.metal::array", ptr addrspace(1), %"struct.metal::texture2d.23" }
|
||||
%"struct.metal::texture2d" = type { ptr addrspace(1) }
|
||||
%"struct.metal::texturecube" = type { ptr addrspace(1) }
|
||||
%"struct.metal::array" = type { [8 x %"struct.metal::texture2d"] }
|
||||
%"struct.metal::texture2d.23" = type { ptr addrspace(1) }
|
||||
%struct.Material = type { <4 x float>, i32, i32, i32, i32 }
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
|
||||
define <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> @abt_vert_plain(i32 noundef %0) local_unnamed_addr #0 {
|
||||
%2 = shl i32 %0, 1
|
||||
%3 = and i32 %2, 2
|
||||
%4 = tail call fast float @air.convert.f.f32.u.i32(i32 %3) #7
|
||||
%5 = insertelement <2 x float> undef, float %4, i64 0
|
||||
%6 = and i32 %0, 2
|
||||
%7 = tail call fast float @air.convert.f.f32.u.i32(i32 %6) #7
|
||||
%8 = insertelement <2 x float> %5, float %7, i64 1
|
||||
%9 = fmul fast <2 x float> %8, <float 2.000000e+00, float -2.000000e+00>
|
||||
%10 = fadd fast <2 x float> %9, <float -1.000000e+00, float 1.000000e+00>
|
||||
%11 = shufflevector <2 x float> %10, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
|
||||
%12 = shufflevector <4 x float> %11, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%13 = fmul fast <2 x float> %8, splat (float 2.000000e+00)
|
||||
%14 = fadd fast <2 x float> %13, splat (float -1.000000e+00)
|
||||
%15 = shufflevector <2 x float> %14, <2 x float> poison, <3 x i32> <i32 0, i32 1, i32 poison>
|
||||
%16 = insertelement <3 x float> %15, float 1.000000e+00, i64 2
|
||||
%17 = shufflevector <2 x float> %8, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
|
||||
%18 = shufflevector <4 x float> %17, <4 x float> <float poison, float poison, float 5.000000e-01, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%19 = and i32 %0, 7
|
||||
%20 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> undef, <4 x float> %12, 0
|
||||
%21 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %20, <2 x float> %8, 1
|
||||
%22 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %21, <3 x float> %16, 2
|
||||
%23 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %22, <4 x float> %18, 3
|
||||
%24 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %23, i32 %19, 4
|
||||
ret <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %24
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> @abt_vert_sets(i32 noundef %0, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(40) "air-buffer-no-alias" %1) local_unnamed_addr #1 {
|
||||
%3 = shl i32 %0, 1
|
||||
%4 = and i32 %3, 2
|
||||
%5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #7
|
||||
%6 = insertelement <2 x float> undef, float %5, i64 0
|
||||
%7 = and i32 %0, 2
|
||||
%8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #7
|
||||
%9 = insertelement <2 x float> %6, float %8, i64 1
|
||||
%10 = fmul fast <2 x float> %9, <float 2.000000e+00, float -2.000000e+00>
|
||||
%11 = fadd fast <2 x float> %10, <float -1.000000e+00, float 1.000000e+00>
|
||||
%12 = shufflevector <2 x float> %11, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
|
||||
%13 = shufflevector <4 x float> %12, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%14 = fmul fast <2 x float> %9, splat (float 2.000000e+00)
|
||||
%15 = fadd fast <2 x float> %14, splat (float -1.000000e+00)
|
||||
%16 = shufflevector <2 x float> %15, <2 x float> poison, <3 x i32> <i32 0, i32 1, i32 poison>
|
||||
%17 = insertelement <3 x float> %16, float 1.000000e+00, i64 2
|
||||
%18 = shufflevector <2 x float> %9, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
|
||||
%19 = shufflevector <4 x float> %18, <4 x float> <float poison, float poison, float 5.000000e-01, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%20 = and i32 %0, 7
|
||||
%21 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %1, i64 0, i32 3, i32 0
|
||||
%22 = load ptr addrspace(1), ptr addrspace(1) %21, align 8, !tbaa !81, !alias.scope !86
|
||||
%23 = tail call ptr addrspace(2) @air.get_read_sampler() #8
|
||||
%24 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(ptr addrspace(1) readonly captures(none) %22, ptr addrspace(2) %23, i32 %0, i32 1) #9
|
||||
%25 = extractvalue { <4 x float>, i8 } %24, 0
|
||||
%26 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %1, i64 0, i32 0
|
||||
%27 = load ptr addrspace(2), ptr addrspace(1) %26, align 8, !tbaa !89, !alias.scope !86
|
||||
%28 = getelementptr inbounds %struct.Frame, ptr addrspace(2) %27, i64 0, i32 1
|
||||
%29 = load <4 x float>, ptr addrspace(2) %28, align 16
|
||||
%30 = fmul fast <4 x float> %29, %25
|
||||
%31 = fadd fast <4 x float> %30, %13
|
||||
%32 = shufflevector <4 x float> %31, <4 x float> %13, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%33 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> undef, <4 x float> %32, 0
|
||||
%34 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %33, <2 x float> %9, 1
|
||||
%35 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %34, <3 x float> %17, 2
|
||||
%36 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %35, <4 x float> %19, 3
|
||||
%37 = insertvalue <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %36, i32 %20, 4
|
||||
ret <{ <4 x float>, <2 x float>, <3 x float>, <4 x float>, i32 }> %37
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_sample(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(112) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %4, i64 0, i32 1, i32 0
|
||||
%7 = load ptr addrspace(2), ptr addrspace(1) %6, align 8, !tbaa.struct !97, !alias.scope !99
|
||||
%8 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %4, i64 0, i32 0, i32 0
|
||||
%9 = load ptr addrspace(1), ptr addrspace(1) %8, align 8, !tbaa !102, !alias.scope !99
|
||||
%10 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %9, ptr addrspace(2) readonly captures(none) %7, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%11 = extractvalue { <4 x float>, i8 } %10, 0
|
||||
%12 = insertvalue <{ <4 x float> }> undef, <4 x float> %11, 0
|
||||
ret <{ <4 x float> }> %12
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_compare(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(40) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 2, i32 0
|
||||
%7 = load ptr addrspace(2), ptr addrspace(1) %6, align 8, !tbaa.struct !97, !alias.scope !105
|
||||
%8 = shufflevector <4 x float> %2, <4 x float> poison, <2 x i32> <i32 0, i32 1>
|
||||
%9 = extractelement <4 x float> %2, i64 2
|
||||
%10 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 1, i32 0
|
||||
%11 = load ptr addrspace(1), ptr addrspace(1) %10, align 8, !tbaa !108, !alias.scope !105
|
||||
%12 = tail call { float, i8 } @air.sample_compare_depth_2d.f32(ptr addrspace(1) readonly captures(none) %11, ptr addrspace(2) readonly captures(none) %7, i32 1, <2 x float> %8, float %9, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%13 = extractvalue { float, i8 } %12, 0
|
||||
%14 = insertelement <4 x float> poison, float %13, i64 0
|
||||
%15 = shufflevector <4 x float> %14, <4 x float> poison, <4 x i32> zeroinitializer
|
||||
%16 = insertvalue <{ <4 x float> }> undef, <4 x float> %15, 0
|
||||
ret <{ <4 x float> }> %16
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_cube(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(112) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %4, i64 0, i32 3, i32 0
|
||||
%7 = load ptr addrspace(2), ptr addrspace(1) %6, align 8, !tbaa.struct !97, !alias.scope !109
|
||||
%8 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %4, i64 0, i32 2, i32 0
|
||||
%9 = load ptr addrspace(1), ptr addrspace(1) %8, align 8, !tbaa !112, !alias.scope !109
|
||||
%10 = tail call { <4 x float>, i8 } @air.sample_texture_cube.v4f32(ptr addrspace(1) readonly captures(none) %9, ptr addrspace(2) readonly captures(none) %7, <3 x float> %1, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%11 = extractvalue { <4 x float>, i8 } %10, 0
|
||||
%12 = insertvalue <{ <4 x float> }> undef, <4 x float> %11, 0
|
||||
ret <{ <4 x float> }> %12
|
||||
}
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_array(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(112) "air-buffer-no-alias" %4) local_unnamed_addr #2 {
|
||||
%6 = zext i32 %3 to i64
|
||||
%7 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %4, i64 0, i32 1, i32 0
|
||||
%8 = load ptr addrspace(2), ptr addrspace(1) %7, align 8, !tbaa.struct !97, !alias.scope !115
|
||||
%9 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %4, i64 0, i32 4, i32 0, i64 %6, i32 0
|
||||
%10 = load ptr addrspace(1), ptr addrspace(1) %9, align 8, !tbaa !102, !alias.scope !115
|
||||
%11 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %10, ptr addrspace(2) readonly captures(none) %8, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%12 = extractvalue { <4 x float>, i8 } %11, 0
|
||||
%13 = insertvalue <{ <4 x float> }> undef, <4 x float> %12, 0
|
||||
ret <{ <4 x float> }> %13
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_texel_buffer(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(40) "air-buffer-no-alias" %4) local_unnamed_addr #1 {
|
||||
%6 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 3, i32 0
|
||||
%7 = load ptr addrspace(1), ptr addrspace(1) %6, align 8, !tbaa !81, !alias.scope !118
|
||||
%8 = tail call ptr addrspace(2) @air.get_read_sampler() #8
|
||||
%9 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(ptr addrspace(1) readonly captures(none) %7, ptr addrspace(2) %8, i32 %3, i32 1) #9
|
||||
%10 = extractvalue { <4 x float>, i8 } %9, 0
|
||||
%11 = insertvalue <{ <4 x float> }> undef, <4 x float> %10, 0
|
||||
ret <{ <4 x float> }> %11
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_storage(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, <4 x float> noundef %4, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(112) "air-buffer-no-alias" %5) local_unnamed_addr #1 {
|
||||
%7 = shufflevector <4 x float> %4, <4 x float> poison, <2 x i32> <i32 0, i32 1>
|
||||
%8 = tail call <2 x i32> @air.convert.u.v2i32.f.v2f32(<2 x float> %7) #7
|
||||
%9 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 6, i32 0
|
||||
%10 = load ptr addrspace(1), ptr addrspace(1) %9, align 8, !tbaa !121, !alias.scope !123
|
||||
%11 = tail call ptr addrspace(2) @air.get_read_sampler() #8
|
||||
%12 = tail call { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %10, ptr addrspace(2) %11, <2 x i32> %8, <2 x i32> zeroinitializer, i32 0, i32 3) #9
|
||||
%13 = extractvalue { <4 x float>, i8 } %12, 0
|
||||
%14 = insertvalue <{ <4 x float> }> undef, <4 x float> %13, 0
|
||||
ret <{ <4 x float> }> %14
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
|
||||
declare <2 x i32> @air.convert.u.v2i32.f.v2f32(<2 x float>) local_unnamed_addr #3
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_sets(<2 x float> %0, <3 x float> %1, <4 x float> %2, i32 %3, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(40) "air-buffer-no-alias" %4, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(112) "air-buffer-no-alias" %5) local_unnamed_addr #2 {
|
||||
%7 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 5
|
||||
%8 = load ptr addrspace(1), ptr addrspace(1) %7, align 8, !tbaa !126, !alias.scope !129, !noalias !132
|
||||
%9 = zext i32 %3 to i64
|
||||
%10 = getelementptr inbounds %struct.Material, ptr addrspace(1) %8, i64 %9, i32 0
|
||||
%11 = load <4 x float>, ptr addrspace(1) %10, align 16, !tbaa.struct !134
|
||||
%12 = getelementptr inbounds %struct.Material, ptr addrspace(1) %8, i64 %9, i32 1
|
||||
%13 = load i32, ptr addrspace(1) %12, align 16, !tbaa.struct !138
|
||||
%14 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 1, i32 0
|
||||
%15 = load ptr addrspace(2), ptr addrspace(1) %14, align 8, !alias.scope !129, !noalias !132
|
||||
%16 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 0, i32 0
|
||||
%17 = load ptr addrspace(1), ptr addrspace(1) %16, align 8, !tbaa !102, !alias.scope !129, !noalias !132
|
||||
%18 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %17, ptr addrspace(2) readonly captures(none) %15, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%19 = extractvalue { <4 x float>, i8 } %18, 0
|
||||
%20 = zext i32 %13 to i64
|
||||
%21 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 4, i32 0, i64 %20, i32 0
|
||||
%22 = load ptr addrspace(1), ptr addrspace(1) %21, align 8, !tbaa !102, !alias.scope !129, !noalias !132
|
||||
%23 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %22, ptr addrspace(2) readonly captures(none) %15, <2 x float> %0, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%24 = extractvalue { <4 x float>, i8 } %23, 0
|
||||
%25 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 3, i32 0
|
||||
%26 = load ptr addrspace(2), ptr addrspace(1) %25, align 8, !tbaa.struct !97, !alias.scope !129, !noalias !132
|
||||
%27 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %5, i64 0, i32 2, i32 0
|
||||
%28 = load ptr addrspace(1), ptr addrspace(1) %27, align 8, !tbaa !112, !alias.scope !129, !noalias !132
|
||||
%29 = tail call { <4 x float>, i8 } @air.sample_texture_cube.v4f32(ptr addrspace(1) readonly captures(none) %28, ptr addrspace(2) readonly captures(none) %26, <3 x float> %1, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%30 = extractvalue { <4 x float>, i8 } %29, 0
|
||||
%31 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 2, i32 0
|
||||
%32 = load ptr addrspace(2), ptr addrspace(1) %31, align 8, !tbaa.struct !97, !alias.scope !132, !noalias !129
|
||||
%33 = shufflevector <4 x float> %2, <4 x float> poison, <2 x i32> <i32 0, i32 1>
|
||||
%34 = extractelement <4 x float> %2, i64 2
|
||||
%35 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 1, i32 0
|
||||
%36 = load ptr addrspace(1), ptr addrspace(1) %35, align 8, !tbaa !108, !alias.scope !132, !noalias !129
|
||||
%37 = tail call { float, i8 } @air.sample_compare_depth_2d.f32(ptr addrspace(1) readonly captures(none) %36, ptr addrspace(2) readonly captures(none) %32, i32 1, <2 x float> %33, float %34, i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%38 = extractvalue { float, i8 } %37, 0
|
||||
%39 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 3, i32 0
|
||||
%40 = load ptr addrspace(1), ptr addrspace(1) %39, align 8, !tbaa !81, !alias.scope !132, !noalias !129
|
||||
%41 = tail call ptr addrspace(2) @air.get_read_sampler() #8
|
||||
%42 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(ptr addrspace(1) readonly captures(none) %40, ptr addrspace(2) %41, i32 %3, i32 1) #9
|
||||
%43 = extractvalue { <4 x float>, i8 } %42, 0
|
||||
%44 = insertelement <4 x float> poison, float %38, i64 0
|
||||
%45 = shufflevector <4 x float> %44, <4 x float> poison, <4 x i32> zeroinitializer
|
||||
%46 = fmul fast <4 x float> %45, %19
|
||||
%47 = fadd fast <4 x float> %30, %24
|
||||
%48 = fadd fast <4 x float> %47, %46
|
||||
%49 = fadd fast <4 x float> %48, %43
|
||||
%50 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %4, i64 0, i32 0
|
||||
%51 = load ptr addrspace(2), ptr addrspace(1) %50, align 8, !tbaa !89, !alias.scope !132, !noalias !129
|
||||
%52 = getelementptr inbounds %struct.Frame, ptr addrspace(2) %51, i64 0, i32 0
|
||||
%53 = load <4 x float>, ptr addrspace(2) %52, align 16, !tbaa !135
|
||||
%54 = fmul fast <4 x float> %53, %11
|
||||
%55 = fmul fast <4 x float> %54, %49
|
||||
%56 = insertvalue <{ <4 x float> }> undef, <4 x float> %55, 0
|
||||
ret <{ <4 x float> }> %56
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float>, <4 x float>, i32 }> @abt_vert_bones(i32 noundef %0, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(40) "air-buffer-no-alias" %1) local_unnamed_addr #1 {
|
||||
%3 = shl i32 %0, 1
|
||||
%4 = and i32 %3, 2
|
||||
%5 = tail call fast float @air.convert.f.f32.u.i32(i32 %4) #7
|
||||
%6 = insertelement <2 x float> undef, float %5, i64 0
|
||||
%7 = and i32 %0, 2
|
||||
%8 = tail call fast float @air.convert.f.f32.u.i32(i32 %7) #7
|
||||
%9 = insertelement <2 x float> %6, float %8, i64 1
|
||||
%10 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %1, i64 0, i32 0
|
||||
%11 = load ptr addrspace(2), ptr addrspace(1) %10, align 8, !tbaa !89, !alias.scope !139
|
||||
%12 = getelementptr inbounds %struct.Frame, ptr addrspace(2) %11, i64 0, i32 1
|
||||
%13 = load <4 x float>, ptr addrspace(2) %12, align 16
|
||||
%14 = extractelement <4 x float> %13, i64 0
|
||||
%15 = tail call i32 @air.convert.u.i32.f.f32(float %14) #7
|
||||
%16 = fmul fast <2 x float> %9, <float 2.000000e+00, float -2.000000e+00>
|
||||
%17 = fadd fast <2 x float> %16, <float -1.000000e+00, float 1.000000e+00>
|
||||
%18 = shufflevector <2 x float> %17, <2 x float> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
|
||||
%19 = shufflevector <4 x float> %18, <4 x float> <float poison, float poison, float 0.000000e+00, float 1.000000e+00>, <4 x i32> <i32 0, i32 1, i32 6, i32 7>
|
||||
%20 = add i32 %15, %0
|
||||
%21 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %1, i64 0, i32 3, i32 0
|
||||
%22 = load ptr addrspace(1), ptr addrspace(1) %21, align 8, !tbaa !81, !alias.scope !139
|
||||
%23 = tail call ptr addrspace(2) @air.get_read_sampler() #8
|
||||
%24 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(ptr addrspace(1) readonly captures(none) %22, ptr addrspace(2) %23, i32 %20, i32 1) #9
|
||||
%25 = extractvalue { <4 x float>, i8 } %24, 0
|
||||
%26 = add i32 %20, 3
|
||||
%27 = insertvalue <{ <4 x float>, <4 x float>, i32 }> undef, <4 x float> %19, 0
|
||||
%28 = insertvalue <{ <4 x float>, <4 x float>, i32 }> %27, <4 x float> %25, 1
|
||||
%29 = insertvalue <{ <4 x float>, <4 x float>, i32 }> %28, i32 %26, 2
|
||||
ret <{ <4 x float>, <4 x float>, i32 }> %29
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
|
||||
declare float @air.convert.f.f32.u.i32(i32) local_unnamed_addr #3
|
||||
|
||||
; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
|
||||
declare i32 @air.convert.u.i32.f.f32(float) local_unnamed_addr #3
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(read)
|
||||
define <{ <4 x float> }> @abt_frag_bones(<4 x float> %0, i32 %1, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(40) "air-buffer-no-alias" %2, ptr addrspace(1) noundef readonly align 8 captures(none) dereferenceable(112) "air-buffer-no-alias" %3) local_unnamed_addr #2 {
|
||||
%5 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %2, i64 0, i32 3, i32 0
|
||||
%6 = load ptr addrspace(1), ptr addrspace(1) %5, align 8, !tbaa !81, !alias.scope !142, !noalias !145
|
||||
%7 = tail call ptr addrspace(2) @air.get_read_sampler() #8
|
||||
%8 = tail call { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(ptr addrspace(1) readonly captures(none) %6, ptr addrspace(2) %7, i32 %1, i32 1) #9
|
||||
%9 = extractvalue { <4 x float>, i8 } %8, 0
|
||||
%10 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %3, i64 0, i32 1, i32 0
|
||||
%11 = load ptr addrspace(2), ptr addrspace(1) %10, align 8, !tbaa.struct !97, !alias.scope !145, !noalias !142
|
||||
%12 = getelementptr inbounds %struct.spvDescriptorSetBuffer1, ptr addrspace(1) %3, i64 0, i32 0, i32 0
|
||||
%13 = load ptr addrspace(1), ptr addrspace(1) %12, align 8, !tbaa !102, !alias.scope !145, !noalias !142
|
||||
%14 = tail call { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none) %13, ptr addrspace(2) readonly captures(none) %11, <2 x float> splat (float 5.000000e-01), i1 true, <2 x i32> zeroinitializer, i1 false, float 0.000000e+00, float 0.000000e+00, i32 0) #10
|
||||
%15 = extractvalue { <4 x float>, i8 } %14, 0
|
||||
%16 = getelementptr inbounds %struct.spvDescriptorSetBuffer0, ptr addrspace(1) %2, i64 0, i32 0
|
||||
%17 = load ptr addrspace(2), ptr addrspace(1) %16, align 8, !tbaa !89, !alias.scope !142, !noalias !145
|
||||
%18 = getelementptr inbounds %struct.Frame, ptr addrspace(2) %17, i64 0, i32 0
|
||||
%19 = load <4 x float>, ptr addrspace(2) %18, align 16, !tbaa !135
|
||||
%20 = fmul fast <4 x float> %19, %9
|
||||
%21 = fadd fast <4 x float> %15, %0
|
||||
%22 = fadd fast <4 x float> %21, %20
|
||||
%23 = insertvalue <{ <4 x float> }> undef, <4 x float> %22, 0
|
||||
ret <{ <4 x float> }> %23
|
||||
}
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(inaccessiblemem: read)
|
||||
declare ptr addrspace(2) @air.get_read_sampler() local_unnamed_addr #4
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
|
||||
declare { <4 x float>, i8 } @air.read_texture_buffer_1d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2), i32, i32) local_unnamed_addr #5
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(argmem: read)
|
||||
declare { <4 x float>, i8 } @air.sample_texture_2d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2) readonly captures(none), <2 x float>, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #6
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(argmem: read)
|
||||
declare { float, i8 } @air.sample_compare_depth_2d.f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2) readonly captures(none), i32, <2 x float>, float, i1, <2 x i32>, i1, float, float, i32) local_unnamed_addr #6
|
||||
|
||||
; Function Attrs: convergent mustprogress nofree nounwind willreturn memory(argmem: read)
|
||||
declare { <4 x float>, i8 } @air.sample_texture_cube.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2) readonly captures(none), <3 x float>, i1, float, float, i32) local_unnamed_addr #6
|
||||
|
||||
; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
|
||||
declare { <4 x float>, i8 } @air.read_texture_2d.v4f32(ptr addrspace(1) readonly captures(none), ptr addrspace(2), <2 x i32>, <2 x i32>, i32, i32) local_unnamed_addr #5
|
||||
|
||||
attributes #0 = { mustprogress nofree nosync nounwind willreturn memory(none) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #1 = { mustprogress nofree nounwind willreturn memory(read) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #2 = { convergent mustprogress nofree nounwind willreturn memory(read) "approx-func-fp-math"="true" "frame-pointer"="all" "min-legal-vector-width"="128" "no-builtins" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "unsafe-fp-math"="true" }
|
||||
attributes #3 = { mustprogress nofree nosync nounwind willreturn memory(none) }
|
||||
attributes #4 = { mustprogress nofree nounwind willreturn memory(inaccessiblemem: read) }
|
||||
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) }
|
||||
attributes #6 = { convergent mustprogress nofree nounwind willreturn memory(argmem: read) }
|
||||
attributes #7 = { nounwind willreturn memory(none) }
|
||||
attributes #8 = { nounwind willreturn memory(inaccessiblemem: read) }
|
||||
attributes #9 = { nounwind willreturn memory(argmem: read) }
|
||||
attributes #10 = { convergent nounwind willreturn memory(argmem: read) }
|
||||
|
||||
!llvm.module.flags = !{!0, !1, !2, !3, !4, !5, !6, !7, !8}
|
||||
!air.vertex = !{!9, !18, !28}
|
||||
!air.fragment = !{!32, !50, !55, !58, !61, !63, !67, !69}
|
||||
!air.compile_options = !{!75, !76, !77}
|
||||
!llvm.ident = !{!78}
|
||||
!air.version = !{!79}
|
||||
!air.language_version = !{!80}
|
||||
|
||||
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 27, i32 2]}
|
||||
!1 = !{i32 1, !"wchar_size", i32 4}
|
||||
!2 = !{i32 7, !"frame-pointer", i32 2}
|
||||
!3 = !{i32 7, !"air.max_device_buffers", i32 31}
|
||||
!4 = !{i32 7, !"air.max_constant_buffers", i32 31}
|
||||
!5 = !{i32 7, !"air.max_threadgroup_buffers", i32 31}
|
||||
!6 = !{i32 7, !"air.max_textures", i32 128}
|
||||
!7 = !{i32 7, !"air.max_read_write_textures", i32 8}
|
||||
!8 = !{i32 7, !"air.max_samplers", i32 16}
|
||||
!9 = !{ptr @abt_vert_plain, !10, !16}
|
||||
!10 = !{!11, !12, !13, !14, !15}
|
||||
!11 = !{!"air.position", !"air.arg_type_name", !"float4", !"air.arg_name", !"position"}
|
||||
!12 = !{!"air.vertex_output", !"user(locn0)", !"air.arg_type_name", !"float2", !"air.arg_name", !"uv"}
|
||||
!13 = !{!"air.vertex_output", !"user(locn1)", !"air.arg_type_name", !"float3", !"air.arg_name", !"dir"}
|
||||
!14 = !{!"air.vertex_output", !"user(locn2)", !"air.arg_type_name", !"float4", !"air.arg_name", !"shadow"}
|
||||
!15 = !{!"air.vertex_output", !"user(locn3)", !"air.arg_type_name", !"uint", !"air.arg_name", !"layer"}
|
||||
!16 = !{!17}
|
||||
!17 = !{i32 0, !"air.vertex_id", !"air.arg_type_name", !"uint", !"air.arg_name", !"vid"}
|
||||
!18 = !{ptr @abt_vert_sets, !10, !19}
|
||||
!19 = !{!17, !20}
|
||||
!20 = !{i32 1, !"air.indirect_buffer", !"air.buffer_size", i32 40, !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !21, !"air.arg_type_size", i32 40, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer0", !"air.arg_name", !"spvDescriptorSet0"}
|
||||
!21 = !{i32 0, i32 8, i32 0, !"Frame", !"m_frame", !"air.indirect_argument", !22, i32 8, i32 8, i32 0, !"depth2d<float, sample>", !"shadowMap", !"air.indirect_argument", !24, i32 16, i32 8, i32 0, !"sampler", !"shadowMapSmplr", !"air.indirect_argument", !25, i32 24, i32 8, i32 0, !"texture_buffer<float, read>", !"bones", !"air.indirect_argument", !26, i32 32, i32 8, i32 0, !"texture_buffer<float, read_write>", !"_m4_pad", !"air.indirect_argument", !27}
|
||||
!22 = !{i32 0, !"air.buffer", !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 2, !"air.struct_type_info", !23, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"Frame", !"air.arg_name", !"m_frame"}
|
||||
!23 = !{i32 0, i32 16, i32 0, !"float4", !"tint", i32 16, i32 16, i32 0, !"float4", !"offset"}
|
||||
!24 = !{i32 1, !"air.texture", !"air.location_index", i32 1, i32 1, !"air.sample", !"air.arg_type_name", !"depth2d<float, sample>", !"air.arg_name", !"shadowMap"}
|
||||
!25 = !{i32 2, !"air.sampler", !"air.location_index", i32 2, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"shadowMapSmplr"}
|
||||
!26 = !{i32 3, !"air.texture", !"air.location_index", i32 3, i32 1, !"air.read", !"air.arg_type_name", !"texture_buffer<float, read>", !"air.arg_name", !"bones"}
|
||||
!27 = !{i32 4, !"air.texture", !"air.location_index", i32 4, i32 1, !"air.read_write", !"air.arg_type_name", !"texture_buffer<float, read_write>", !"air.arg_name", !"_m4_pad"}
|
||||
!28 = !{ptr @abt_vert_bones, !29, !19}
|
||||
!29 = !{!11, !30, !31}
|
||||
!30 = !{!"air.vertex_output", !"user(locn0)", !"air.arg_type_name", !"float4", !"air.arg_name", !"bone"}
|
||||
!31 = !{!"air.vertex_output", !"user(locn1)", !"air.arg_type_name", !"uint", !"air.arg_name", !"index"}
|
||||
!32 = !{ptr @abt_frag_sample, !33, !35}
|
||||
!33 = !{!34}
|
||||
!34 = !{!"air.render_target", i32 0, i32 0, !"air.arg_type_name", !"float4", !"air.arg_name", !"color"}
|
||||
!35 = !{!36, !37, !38, !39, !40}
|
||||
!36 = !{i32 0, !"air.fragment_input", !"user(locn0)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float2", !"air.arg_name", !"uv"}
|
||||
!37 = !{i32 1, !"air.fragment_input", !"user(locn1)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float3", !"air.arg_name", !"dir", !"air.arg_unused"}
|
||||
!38 = !{i32 2, !"air.fragment_input", !"user(locn2)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"shadow", !"air.arg_unused"}
|
||||
!39 = !{i32 3, !"air.fragment_input", !"user(locn3)", !"air.flat", !"air.arg_type_name", !"uint", !"air.arg_name", !"layer", !"air.arg_unused"}
|
||||
!40 = !{i32 4, !"air.indirect_buffer", !"air.buffer_size", i32 112, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !41, !"air.arg_type_size", i32 112, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer1", !"air.arg_name", !"spvDescriptorSet1"}
|
||||
!41 = !{i32 0, i32 8, i32 0, !"texture2d<float, sample>", !"albedo", !"air.indirect_argument", !42, i32 8, i32 8, i32 0, !"sampler", !"linearSmplr", !"air.indirect_argument", !43, i32 16, i32 8, i32 0, !"texturecube<float, sample>", !"env", !"air.indirect_argument", !44, i32 24, i32 8, i32 0, !"sampler", !"envSmplr", !"air.indirect_argument", !45, i32 32, i32 64, i32 0, !"array<texture2d<float, sample>, 8>", !"layers", !"air.indirect_argument", !46, i32 96, i32 8, i32 0, !"Material", !"materials", !"air.indirect_argument", !47, i32 104, i32 8, i32 0, !"texture2d<float, read_write>", !"scratch", !"air.indirect_argument", !49}
|
||||
!42 = !{i32 0, !"air.texture", !"air.location_index", i32 0, i32 1, !"air.sample", !"air.arg_type_name", !"texture2d<float, sample>", !"air.arg_name", !"albedo"}
|
||||
!43 = !{i32 1, !"air.sampler", !"air.location_index", i32 1, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"linearSmplr"}
|
||||
!44 = !{i32 2, !"air.texture", !"air.location_index", i32 2, i32 1, !"air.sample", !"air.arg_type_name", !"texturecube<float, sample>", !"air.arg_name", !"env"}
|
||||
!45 = !{i32 3, !"air.sampler", !"air.location_index", i32 3, i32 1, !"air.arg_type_name", !"sampler", !"air.arg_name", !"envSmplr"}
|
||||
!46 = !{i32 4, !"air.texture", !"air.location_index", i32 4, i32 8, !"air.sample", !"air.arg_type_name", !"array<texture2d<float, sample>, 8>", !"air.arg_name", !"layers"}
|
||||
!47 = !{i32 5, !"air.buffer", !"air.location_index", i32 12, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !48, !"air.arg_type_size", i32 32, !"air.arg_type_align_size", i32 16, !"air.arg_type_name", !"Material", !"air.arg_name", !"materials"}
|
||||
!48 = !{i32 0, i32 16, i32 0, !"float4", !"scale", i32 16, i32 4, i32 0, !"uint", !"layer", i32 20, i32 4, i32 0, !"uint", !"pad0", i32 24, i32 4, i32 0, !"uint", !"pad1", i32 28, i32 4, i32 0, !"uint", !"pad2"}
|
||||
!49 = !{i32 6, !"air.texture", !"air.location_index", i32 13, i32 1, !"air.read_write", !"air.arg_type_name", !"texture2d<float, read_write>", !"air.arg_name", !"scratch"}
|
||||
!50 = !{ptr @abt_frag_compare, !33, !51}
|
||||
!51 = !{!52, !37, !53, !39, !54}
|
||||
!52 = !{i32 0, !"air.fragment_input", !"user(locn0)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float2", !"air.arg_name", !"uv", !"air.arg_unused"}
|
||||
!53 = !{i32 2, !"air.fragment_input", !"user(locn2)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"shadow"}
|
||||
!54 = !{i32 4, !"air.indirect_buffer", !"air.buffer_size", i32 40, !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !21, !"air.arg_type_size", i32 40, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer0", !"air.arg_name", !"spvDescriptorSet0"}
|
||||
!55 = !{ptr @abt_frag_cube, !33, !56}
|
||||
!56 = !{!52, !57, !38, !39, !40}
|
||||
!57 = !{i32 1, !"air.fragment_input", !"user(locn1)", !"air.center", !"air.perspective", !"air.arg_type_name", !"float3", !"air.arg_name", !"dir"}
|
||||
!58 = !{ptr @abt_frag_array, !33, !59}
|
||||
!59 = !{!36, !37, !38, !60, !40}
|
||||
!60 = !{i32 3, !"air.fragment_input", !"user(locn3)", !"air.flat", !"air.arg_type_name", !"uint", !"air.arg_name", !"layer"}
|
||||
!61 = !{ptr @abt_frag_texel_buffer, !33, !62}
|
||||
!62 = !{!52, !37, !38, !60, !54}
|
||||
!63 = !{ptr @abt_frag_storage, !33, !64}
|
||||
!64 = !{!52, !37, !38, !39, !65, !66}
|
||||
!65 = !{i32 4, !"air.position", !"air.center", !"air.no_perspective", !"air.arg_type_name", !"float4", !"air.arg_name", !"pos"}
|
||||
!66 = !{i32 5, !"air.indirect_buffer", !"air.buffer_size", i32 112, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !41, !"air.arg_type_size", i32 112, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer1", !"air.arg_name", !"spvDescriptorSet1"}
|
||||
!67 = !{ptr @abt_frag_sets, !33, !68}
|
||||
!68 = !{!36, !57, !53, !60, !54, !66}
|
||||
!69 = !{ptr @abt_frag_bones, !33, !70}
|
||||
!70 = !{!71, !72, !73, !74}
|
||||
!71 = !{i32 0, !"air.fragment_input", !"user(locn0)", !"air.flat", !"air.arg_type_name", !"float4", !"air.arg_name", !"bone"}
|
||||
!72 = !{i32 1, !"air.fragment_input", !"user(locn1)", !"air.flat", !"air.arg_type_name", !"uint", !"air.arg_name", !"index"}
|
||||
!73 = !{i32 2, !"air.indirect_buffer", !"air.buffer_size", i32 40, !"air.location_index", i32 0, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !21, !"air.arg_type_size", i32 40, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer0", !"air.arg_name", !"spvDescriptorSet0"}
|
||||
!74 = !{i32 3, !"air.indirect_buffer", !"air.buffer_size", i32 112, !"air.location_index", i32 1, i32 1, !"air.read", !"air.address_space", i32 1, !"air.struct_type_info", !41, !"air.arg_type_size", i32 112, !"air.arg_type_align_size", i32 8, !"air.arg_type_name", !"spvDescriptorSetBuffer1", !"air.arg_name", !"spvDescriptorSet1"}
|
||||
!75 = !{!"air.compile.denorms_disable"}
|
||||
!76 = !{!"air.compile.fast_math_enable"}
|
||||
!77 = !{!"air.compile.framebuffer_fetch_enable"}
|
||||
!78 = !{!"Apple metal version 32023.922 (metalfe-32023.922.4)"}
|
||||
!79 = !{i32 2, i32 8, i32 0}
|
||||
!80 = !{!"Metal", i32 4, i32 0, i32 0}
|
||||
!81 = !{!82, !83, i64 0}
|
||||
!82 = !{!"_ZTSN5metal14texture_bufferIfLNS_6accessE1ELNS_16memory_coherenceE0EvEE", !83, i64 0}
|
||||
!83 = !{!"__metal_texture_buffer_1d_t", !84, i64 0}
|
||||
!84 = !{!"omnipotent char", !85, i64 0}
|
||||
!85 = !{!"Simple C++ TBAA"}
|
||||
!86 = !{!87}
|
||||
!87 = distinct !{!87, !88, !"air-alias-scope-arg(1)"}
|
||||
!88 = distinct !{!88, !"air-alias-scopes(abt_vert_sets)"}
|
||||
!89 = !{!90, !91, i64 0}
|
||||
!90 = !{!"_ZTS23spvDescriptorSetBuffer0", !91, i64 0, !92, i64 8, !94, i64 16, !82, i64 24, !96, i64 32}
|
||||
!91 = !{!"any pointer", !84, i64 0}
|
||||
!92 = !{!"_ZTSN5metal7depth2dIfLNS_6accessE0ELNS_16memory_coherenceE0EvEE", !93, i64 0}
|
||||
!93 = !{!"__metal_depth_2d_t", !84, i64 0}
|
||||
!94 = !{!"_ZTSN5metal7samplerE", !95, i64 0}
|
||||
!95 = !{!"__metal_sampler_t", !84, i64 0}
|
||||
!96 = !{!"_ZTSN5metal14texture_bufferIfLNS_6accessE3ELNS_16memory_coherenceE0EvEE", !83, i64 0}
|
||||
!97 = !{i64 0, i64 8, !98}
|
||||
!98 = !{!95, !95, i64 0}
|
||||
!99 = !{!100}
|
||||
!100 = distinct !{!100, !101, !"air-alias-scope-arg(4)"}
|
||||
!101 = distinct !{!101, !"air-alias-scopes(abt_frag_sample)"}
|
||||
!102 = !{!103, !104, i64 0}
|
||||
!103 = !{!"_ZTSN5metal9texture2dIfLNS_6accessE0ELNS_16memory_coherenceE0EvEE", !104, i64 0}
|
||||
!104 = !{!"__metal_texture_2d_t", !84, i64 0}
|
||||
!105 = !{!106}
|
||||
!106 = distinct !{!106, !107, !"air-alias-scope-arg(4)"}
|
||||
!107 = distinct !{!107, !"air-alias-scopes(abt_frag_compare)"}
|
||||
!108 = !{!92, !93, i64 0}
|
||||
!109 = !{!110}
|
||||
!110 = distinct !{!110, !111, !"air-alias-scope-arg(4)"}
|
||||
!111 = distinct !{!111, !"air-alias-scopes(abt_frag_cube)"}
|
||||
!112 = !{!113, !114, i64 0}
|
||||
!113 = !{!"_ZTSN5metal11texturecubeIfLNS_6accessE0ELNS_16memory_coherenceE0EvEE", !114, i64 0}
|
||||
!114 = !{!"__metal_texture_cube_t", !84, i64 0}
|
||||
!115 = !{!116}
|
||||
!116 = distinct !{!116, !117, !"air-alias-scope-arg(4)"}
|
||||
!117 = distinct !{!117, !"air-alias-scopes(abt_frag_array)"}
|
||||
!118 = !{!119}
|
||||
!119 = distinct !{!119, !120, !"air-alias-scope-arg(4)"}
|
||||
!120 = distinct !{!120, !"air-alias-scopes(abt_frag_texel_buffer)"}
|
||||
!121 = !{!122, !104, i64 0}
|
||||
!122 = !{!"_ZTSN5metal9texture2dIfLNS_6accessE3ELNS_16memory_coherenceE0EvEE", !104, i64 0}
|
||||
!123 = !{!124}
|
||||
!124 = distinct !{!124, !125, !"air-alias-scope-arg(5)"}
|
||||
!125 = distinct !{!125, !"air-alias-scopes(abt_frag_storage)"}
|
||||
!126 = !{!127, !91, i64 96}
|
||||
!127 = !{!"_ZTS23spvDescriptorSetBuffer1", !103, i64 0, !94, i64 8, !113, i64 16, !94, i64 24, !128, i64 32, !91, i64 96, !122, i64 104}
|
||||
!128 = !{!"_ZTSN5metal5arrayINS_9texture2dIfLNS_6accessE0ELNS_16memory_coherenceE0EvEELm8EEE", !84, i64 0}
|
||||
!129 = !{!130}
|
||||
!130 = distinct !{!130, !131, !"air-alias-scope-arg(5)"}
|
||||
!131 = distinct !{!131, !"air-alias-scopes(abt_frag_sets)"}
|
||||
!132 = !{!133}
|
||||
!133 = distinct !{!133, !131, !"air-alias-scope-arg(4)"}
|
||||
!134 = !{i64 0, i64 16, !135, i64 16, i64 4, !136, i64 20, i64 4, !136, i64 24, i64 4, !136, i64 28, i64 4, !136}
|
||||
!135 = !{!84, !84, i64 0}
|
||||
!136 = !{!137, !137, i64 0}
|
||||
!137 = !{!"int", !84, i64 0}
|
||||
!138 = !{i64 0, i64 4, !136, i64 4, i64 4, !136, i64 8, i64 4, !136, i64 12, i64 4, !136}
|
||||
!139 = !{!140}
|
||||
!140 = distinct !{!140, !141, !"air-alias-scope-arg(1)"}
|
||||
!141 = distinct !{!141, !"air-alias-scopes(abt_vert_bones)"}
|
||||
!142 = !{!143}
|
||||
!143 = distinct !{!143, !144, !"air-alias-scope-arg(2)"}
|
||||
!144 = distinct !{!144, !"air-alias-scopes(abt_frag_bones)"}
|
||||
!145 = !{!146}
|
||||
!146 = distinct !{!146, !144, !"air-alias-scope-arg(3)"}
|
||||
@@ -0,0 +1,187 @@
|
||||
// Owned fixture: descriptor sets as Metal argument buffers, in the shape SPIRV-Cross writes for a
|
||||
// Vulkan layer that encodes each descriptor set in one (tier 2): one argument buffer struct per
|
||||
// set at [[buffer(set)]], every binding of the set a member at [[id(k)]] whether the stage uses it
|
||||
// or not (an unused one as a padding member of its kind), a combined image sampler as a texture
|
||||
// member and a sampler member, a texel buffer as a texture_buffer member, a descriptor array as an
|
||||
// array member, and a uniform or storage buffer as a pointer member.
|
||||
//
|
||||
// Each fragment function reads one kind of member, so a refusal names its kind; abt_frag_sets
|
||||
// reads them all, as one fragment function of a real layout does. The vertex functions draw one
|
||||
// triangle over the target from the vertex ID (no stage input), and abt_vert_sets reads a texel
|
||||
// buffer and a uniform buffer from set 0 as a skinning vertex function does.
|
||||
//
|
||||
// abt_vert_bones and abt_frag_bones are the checked pair: the vertex function reads texel
|
||||
// `first + vid` of set 0's texel buffer (`first` the frame's offset.x) into a flat varying, with
|
||||
// the index `first + 3 + vid`; the fragment function writes that varying plus the texel at the
|
||||
// index times the frame's tint, plus set 1's albedo sampled at the centre. With the first vertex
|
||||
// provoking, every fragment writes texel[first] + texel[first + 3] * tint + albedo.
|
||||
#include <metal_stdlib>
|
||||
using namespace metal;
|
||||
|
||||
struct Frame {
|
||||
float4 tint;
|
||||
float4 offset;
|
||||
};
|
||||
|
||||
struct Material {
|
||||
float4 scale;
|
||||
uint layer;
|
||||
uint pad0;
|
||||
uint pad1;
|
||||
uint pad2;
|
||||
};
|
||||
|
||||
// Set 0: a frame's bindings. 0: uniform buffer, 1: combined depth texture and comparison
|
||||
// sampler, 3: uniform texel buffer, 4: storage texel buffer (unused by these stages: padding).
|
||||
struct spvDescriptorSetBuffer0 {
|
||||
constant Frame* m_frame [[id(0)]];
|
||||
depth2d<float> shadowMap [[id(1)]];
|
||||
sampler shadowMapSmplr [[id(2)]];
|
||||
texture_buffer<float> bones [[id(3)]];
|
||||
texture_buffer<float, access::read_write> _m4_pad [[id(4)]];
|
||||
};
|
||||
|
||||
// Set 1: a material's bindings. 0: sampled image, 1: sampler, 2: combined cube texture and
|
||||
// sampler, 4: an array of 8 sampled images, 12: storage buffer, 13: storage image.
|
||||
struct spvDescriptorSetBuffer1 {
|
||||
texture2d<float> albedo [[id(0)]];
|
||||
sampler linearSmplr [[id(1)]];
|
||||
texturecube<float> env [[id(2)]];
|
||||
sampler envSmplr [[id(3)]];
|
||||
array<texture2d<float>, 8> layers [[id(4)]];
|
||||
const device Material* materials [[id(12)]];
|
||||
texture2d<float, access::read_write> scratch [[id(13)]];
|
||||
};
|
||||
|
||||
struct VertOut {
|
||||
float4 position [[position]];
|
||||
float2 uv [[user(locn0)]];
|
||||
float3 dir [[user(locn1)]];
|
||||
float4 shadow [[user(locn2)]];
|
||||
uint layer [[user(locn3)]] [[flat]];
|
||||
};
|
||||
|
||||
struct FragIn {
|
||||
float2 uv [[user(locn0)]];
|
||||
float3 dir [[user(locn1)]];
|
||||
float4 shadow [[user(locn2)]];
|
||||
uint layer [[user(locn3)]] [[flat]];
|
||||
};
|
||||
|
||||
struct FragOut {
|
||||
float4 color [[color(0)]];
|
||||
};
|
||||
|
||||
static VertOut triangle(uint vid) {
|
||||
float2 uv = float2(float((vid << 1) & 2u), float(vid & 2u));
|
||||
VertOut out = {};
|
||||
out.position = float4(uv * float2(2.0f, -2.0f) + float2(-1.0f, 1.0f), 0.0f, 1.0f);
|
||||
out.uv = uv;
|
||||
out.dir = float3(uv * 2.0f - 1.0f, 1.0f);
|
||||
out.shadow = float4(uv, 0.5f, 1.0f);
|
||||
out.layer = vid % 8u;
|
||||
return out;
|
||||
}
|
||||
|
||||
vertex VertOut abt_vert_plain(uint vid [[vertex_id]]) {
|
||||
return triangle(vid);
|
||||
}
|
||||
|
||||
vertex VertOut abt_vert_sets(uint vid [[vertex_id]],
|
||||
const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]]) {
|
||||
VertOut out = triangle(vid);
|
||||
float4 bone = spvDescriptorSet0.bones.read(vid);
|
||||
out.position.xy += bone.xy * (*spvDescriptorSet0.m_frame).offset.xy;
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_sample(FragIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]]) {
|
||||
FragOut out = {};
|
||||
out.color = spvDescriptorSet1.albedo.sample(spvDescriptorSet1.linearSmplr, in.uv);
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_compare(FragIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]]) {
|
||||
FragOut out = {};
|
||||
float lit = spvDescriptorSet0.shadowMap.sample_compare(spvDescriptorSet0.shadowMapSmplr,
|
||||
in.shadow.xy, in.shadow.z);
|
||||
out.color = float4(lit);
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_cube(FragIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]]) {
|
||||
FragOut out = {};
|
||||
out.color = spvDescriptorSet1.env.sample(spvDescriptorSet1.envSmplr, in.dir);
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_array(FragIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]]) {
|
||||
FragOut out = {};
|
||||
out.color = spvDescriptorSet1.layers[in.layer].sample(spvDescriptorSet1.linearSmplr, in.uv);
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_texel_buffer(FragIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]]) {
|
||||
FragOut out = {};
|
||||
out.color = spvDescriptorSet0.bones.read(in.layer);
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_storage(FragIn in [[stage_in]], float4 pos [[position]],
|
||||
const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]]) {
|
||||
FragOut out = {};
|
||||
out.color = spvDescriptorSet1.scratch.read(uint2(pos.xy));
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_sets(FragIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]],
|
||||
const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]]) {
|
||||
FragOut out = {};
|
||||
Material m = spvDescriptorSet1.materials[in.layer];
|
||||
float4 base = spvDescriptorSet1.albedo.sample(spvDescriptorSet1.linearSmplr, in.uv);
|
||||
float4 layer = spvDescriptorSet1.layers[m.layer].sample(spvDescriptorSet1.linearSmplr, in.uv);
|
||||
float4 env = spvDescriptorSet1.env.sample(spvDescriptorSet1.envSmplr, in.dir);
|
||||
float lit = spvDescriptorSet0.shadowMap.sample_compare(spvDescriptorSet0.shadowMapSmplr,
|
||||
in.shadow.xy, in.shadow.z);
|
||||
float4 bone = spvDescriptorSet0.bones.read(in.layer);
|
||||
out.color = (base * lit + env + layer + bone) * m.scale * (*spvDescriptorSet0.m_frame).tint;
|
||||
return out;
|
||||
}
|
||||
|
||||
struct BonesOut {
|
||||
float4 position [[position]];
|
||||
float4 bone [[user(locn0)]] [[flat]];
|
||||
uint index [[user(locn1)]] [[flat]];
|
||||
};
|
||||
|
||||
struct BonesIn {
|
||||
float4 bone [[user(locn0)]] [[flat]];
|
||||
uint index [[user(locn1)]] [[flat]];
|
||||
};
|
||||
|
||||
vertex BonesOut abt_vert_bones(uint vid [[vertex_id]],
|
||||
const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]]) {
|
||||
float2 uv = float2(float((vid << 1) & 2u), float(vid & 2u));
|
||||
uint first = uint((*spvDescriptorSet0.m_frame).offset.x);
|
||||
BonesOut out = {};
|
||||
out.position = float4(uv * float2(2.0f, -2.0f) + float2(-1.0f, 1.0f), 0.0f, 1.0f);
|
||||
out.bone = spvDescriptorSet0.bones.read(first + vid);
|
||||
out.index = first + 3u + vid;
|
||||
return out;
|
||||
}
|
||||
|
||||
fragment FragOut abt_frag_bones(BonesIn in [[stage_in]],
|
||||
const device spvDescriptorSetBuffer0& spvDescriptorSet0 [[buffer(0)]],
|
||||
const device spvDescriptorSetBuffer1& spvDescriptorSet1 [[buffer(1)]]) {
|
||||
FragOut out = {};
|
||||
float4 texel = spvDescriptorSet0.bones.read(in.index);
|
||||
float4 albedo = spvDescriptorSet1.albedo.sample(spvDescriptorSet1.linearSmplr, float2(0.5f));
|
||||
out.color = in.bone + texel * (*spvDescriptorSet0.m_frame).tint + albedo;
|
||||
return out;
|
||||
}
|
||||
@@ -271,6 +271,8 @@ mod argument_buffers;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod argument_linear_samples;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod argument_texel_buffers;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod astc_hdr_textures;
|
||||
#[cfg(all(test, any(m2v_gpu, m2v_cpu_icd)))]
|
||||
mod astc_passes_and_writes;
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
//! Texture buffers read through argument buffers, on the device the cfg selects, under the
|
||||
//! validation layer: descriptor sets encoded as tier-2 argument buffers in the shape SPIRV-Cross
|
||||
//! writes for a Vulkan layer that keeps each set in one (the owned fixture
|
||||
//! `abt_descriptor_sets`), whose texel buffers are `texture_buffer` members. Such a member's
|
||||
//! handle is a set-1 element of a texel-buffer class (`lower::texture`'s heap handles), which
|
||||
//! every live texture buffer's texel buffer view holds at its resource ID (`heap_sets.rs`).
|
||||
|
||||
use super::degrade_notices::on_device_with;
|
||||
use super::{at_plan, buffer_with, WAIT};
|
||||
use crate::air_library::AirLibrary;
|
||||
use metal2vulkan::bind::SamplerDescriptor;
|
||||
use metal2vulkan::metal::{PixelFormat, PrimitiveType, RenderStages, ResourceUsage, TextureUsage};
|
||||
use metal2vulkan::pipeline::{ColorAttachmentDescriptor, RenderPipelineDescriptor, StageSource};
|
||||
use metal2vulkan_devtools::{engine_dir, llvm_assemble};
|
||||
use metal2vulkan_runtime::{
|
||||
Buffer, ClearColor, CommandBufferStatus, Device, LoadAction, PipelineOptions, Region,
|
||||
RenderPassDescriptor, ResourceOptions, SamplerStateOptions, StoreAction, TextureDescriptor,
|
||||
};
|
||||
|
||||
/// The target's side, in pixels.
|
||||
const SIDE: u64 = 4;
|
||||
|
||||
/// The texel buffer's texels: texel `i` is `(i, 10 + i, 20 + i, 30 + i)`.
|
||||
const TEXELS: u64 = 8;
|
||||
|
||||
/// The frame's `offset.x`: the vertex function reads texel `FIRST + vid`, and the index it hands
|
||||
/// on is `FIRST + 3 + vid`.
|
||||
const FIRST: u64 = 1;
|
||||
|
||||
/// The frame's tint.
|
||||
const TINT: [f32; 4] = [0.5, 0.25, 2.0, 1.0];
|
||||
|
||||
/// The albedo texture's one texel, `RGBA8Unorm`: `(1, 0, 1, 0)`.
|
||||
const ALBEDO: [u8; 4] = [255, 0, 255, 0];
|
||||
|
||||
/// Texel `i` of the texel buffer.
|
||||
fn texel(i: u64) -> [f32; 4] {
|
||||
let i = i as f32;
|
||||
[i, 10.0 + i, 20.0 + i, 30.0 + i]
|
||||
}
|
||||
|
||||
/// A buffer of `words`, little-endian.
|
||||
fn words<const N: usize>(device: &Device, words: &[[u8; N]]) -> Buffer {
|
||||
buffer_with(device, &words.concat()).unwrap()
|
||||
}
|
||||
|
||||
/// `abt_vert_bones` reads a texel of set 0's texel buffer through its argument buffer into flat
|
||||
/// varyings, and `abt_frag_bones` reads another of it, with set 1's 2D texture through the
|
||||
/// sampler beside it: the pipeline is made (no `ArgumentBufferTextures` refusal), and every pixel
|
||||
/// is texel[FIRST] + texel[FIRST + 3] · tint + albedo, the texels the texture buffer holds (the
|
||||
/// first vertex provokes, as Metal's does).
|
||||
#[test]
|
||||
fn a_texture_buffer_in_an_argument_buffer_is_read_in_both_stages() {
|
||||
on_device_with(at_plan, |device, _| {
|
||||
let ll = engine_dir().join("abt_descriptor_sets.ll");
|
||||
let library = device
|
||||
.new_library_with_air(&llvm_assemble(&ll).unwrap())
|
||||
.unwrap();
|
||||
let function = |name| {
|
||||
StageSource::Function(
|
||||
library
|
||||
.new_function_with_name(name)
|
||||
.unwrap()
|
||||
.function_descriptor(),
|
||||
)
|
||||
};
|
||||
let mut descriptor = RenderPipelineDescriptor::new(function("abt_vert_bones"));
|
||||
descriptor.fragment = Some(function("abt_frag_bones"));
|
||||
descriptor.color_attachments[0] =
|
||||
Some(ColorAttachmentDescriptor::new(PixelFormat::RGBA32Float));
|
||||
let state = device
|
||||
.new_render_pipeline_state(&descriptor, &PipelineOptions::default())
|
||||
.unwrap_or_else(|e| panic!("the pipeline of a texel buffer argument: {e}"));
|
||||
|
||||
// Set 0's resources: the frame (tint, offset), and the texture buffer over its texels.
|
||||
let frame: Vec<[u8; 4]> = TINT
|
||||
.into_iter()
|
||||
.chain([FIRST as f32, 0.0, 0.0, 0.0])
|
||||
.map(f32::to_le_bytes)
|
||||
.collect();
|
||||
let frame = words(device, &frame);
|
||||
let texels: Vec<[u8; 4]> = (0..TEXELS).flat_map(texel).map(f32::to_le_bytes).collect();
|
||||
let texels = words(device, &texels);
|
||||
let bones = TextureDescriptor::texture_buffer(
|
||||
PixelFormat::RGBA32Float,
|
||||
TEXELS,
|
||||
texels.resource_options(),
|
||||
TextureUsage::SHADER_READ,
|
||||
);
|
||||
let bones = texels.new_texture(&bones, 0, 16 * TEXELS).unwrap();
|
||||
|
||||
// Set 1's resources: the albedo texture and the sampler beside it.
|
||||
let mut albedo = TextureDescriptor::texture_2d(PixelFormat::RGBA8Unorm, 1, 1, false);
|
||||
albedo.usage = TextureUsage::SHADER_READ;
|
||||
let albedo = device.new_texture(&albedo).unwrap();
|
||||
albedo
|
||||
.replace_region(Region::new_2d(0, 0, 1, 1), 0, 0, &ALBEDO, 4, 0)
|
||||
.unwrap();
|
||||
let mut options = SamplerStateOptions::default();
|
||||
options.support_argument_buffers = true;
|
||||
let sampler = device
|
||||
.new_sampler_state_with_options(&SamplerDescriptor::new(), options)
|
||||
.unwrap();
|
||||
|
||||
// The argument buffers, each member's address or resource ID at its field: set 0's
|
||||
// `{frame, shadow map, its sampler, bones, padding}` and set 1's `{albedo, its sampler,
|
||||
// env, its sampler, layers[8], materials, scratch}`, the members neither stage reads nil.
|
||||
let id = |n: u64| n.to_le_bytes();
|
||||
let set0 = words(
|
||||
device,
|
||||
&[
|
||||
id(frame.gpu_address().0),
|
||||
id(0),
|
||||
id(0),
|
||||
id(bones.gpu_resource_id().0),
|
||||
id(0),
|
||||
],
|
||||
);
|
||||
let mut set1 = vec![id(0); 14];
|
||||
set1[0] = id(albedo.gpu_resource_id().0);
|
||||
set1[1] = id(sampler.gpu_resource_id().0);
|
||||
let set1 = words(device, &set1);
|
||||
|
||||
let mut target = TextureDescriptor::texture_2d(PixelFormat::RGBA32Float, SIDE, SIDE, false);
|
||||
target.usage = TextureUsage::RENDER_TARGET;
|
||||
target.resource_options = ResourceOptions::shared();
|
||||
let target = device.new_texture(&target).unwrap();
|
||||
let mut pass = RenderPassDescriptor::new();
|
||||
let color = &mut pass.color_attachments[0];
|
||||
color.texture = Some(target.clone());
|
||||
color.load_action = LoadAction::Clear;
|
||||
color.store_action = StoreAction::Store;
|
||||
color.clear_color = ClearColor::new(-1.0, -1.0, -1.0, -1.0);
|
||||
|
||||
let queue = device.new_command_queue().unwrap();
|
||||
let command_buffer = queue.command_buffer().unwrap();
|
||||
let mut encoder = command_buffer.render_command_encoder(&pass).unwrap();
|
||||
encoder.set_render_pipeline_state(&state).unwrap();
|
||||
encoder.set_vertex_buffer(Some(&set0), 0, 0).unwrap();
|
||||
encoder.set_fragment_buffer(Some(&set0), 0, 0).unwrap();
|
||||
encoder.set_fragment_buffer(Some(&set1), 0, 1).unwrap();
|
||||
let both = RenderStages::VERTEX.union(RenderStages::FRAGMENT);
|
||||
encoder
|
||||
.use_resource(frame.as_resource(), ResourceUsage::READ, both)
|
||||
.unwrap();
|
||||
encoder
|
||||
.use_resource(bones.as_resource(), ResourceUsage::READ, both)
|
||||
.unwrap();
|
||||
encoder
|
||||
.use_resource(
|
||||
albedo.as_resource(),
|
||||
ResourceUsage::READ,
|
||||
RenderStages::FRAGMENT,
|
||||
)
|
||||
.unwrap();
|
||||
encoder
|
||||
.draw_primitives(PrimitiveType::Triangle, 0, 3, 1, 0)
|
||||
.unwrap();
|
||||
encoder.end_encoding().unwrap();
|
||||
command_buffer.commit().unwrap();
|
||||
command_buffer.wait_until_completed_for(WAIT).unwrap();
|
||||
assert_eq!(command_buffer.status(), CommandBufferStatus::Completed);
|
||||
assert_eq!(command_buffer.error(), None);
|
||||
|
||||
let mut bytes = vec![0u8; (16 * SIDE * SIDE) as usize];
|
||||
target
|
||||
.get_bytes(
|
||||
&mut bytes,
|
||||
16 * SIDE,
|
||||
0,
|
||||
Region::new_2d(0, 0, SIDE, SIDE),
|
||||
0,
|
||||
0,
|
||||
)
|
||||
.unwrap();
|
||||
let (bone, read) = (texel(FIRST), texel(FIRST + 3));
|
||||
let want: [f32; 4] =
|
||||
std::array::from_fn(|c| bone[c] + read[c] * TINT[c] + f32::from(ALBEDO[c]) / 255.0);
|
||||
for (i, pixel) in bytes.as_chunks::<16>().0.iter().enumerate() {
|
||||
let got: [f32; 4] = std::array::from_fn(|c| {
|
||||
f32::from_le_bytes([
|
||||
pixel[4 * c],
|
||||
pixel[4 * c + 1],
|
||||
pixel[4 * c + 2],
|
||||
pixel[4 * c + 3],
|
||||
])
|
||||
});
|
||||
assert_eq!(got, want, "pixel {i}");
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -13,7 +13,9 @@
|
||||
//! Used textures come first, by token, then bound ones by slot; member `i` is element `i + 1`
|
||||
//! of **every** class array, so the table maps a resource id to one element. Element 0
|
||||
//! ([`NEUTRAL_ELEMENT`]) is each class's neutral, the value of the null handle and of every
|
||||
//! missed id. Texture buffers are not members (no heap class holds one).
|
||||
//! missed id. Texture buffers are no members: only a heap set a consumer keeps for every
|
||||
//! command holds them, each at its resource ID's element of the texel-buffer classes
|
||||
//! ([`heap_element`]), so a planned heap's handle naming one misses.
|
||||
//! - **Elements.** Element `e` of the array of a class holds member `e - 1` when it fits the
|
||||
//! class (`fit`: the Metal texture type's dimension, arrayedness, and multisampling, a
|
||||
//! sample count above 1 exactly when multisampled, the numeric type, a depth format for a
|
||||
@@ -267,15 +269,21 @@ fn dims(t: TextureType) -> (ImageDim, bool, bool) {
|
||||
|
||||
/// How a texture of view facts `shape` fits the heap array of `class` (the module docs).
|
||||
pub(crate) fn fit(shape: &TextureShape, class: &ImageHandleClass) -> Fit {
|
||||
let TextureShape::Texture {
|
||||
texture_type,
|
||||
pixel_format,
|
||||
sample_count,
|
||||
usage,
|
||||
..
|
||||
} = *shape
|
||||
else {
|
||||
return Fit::No;
|
||||
let (texture_type, pixel_format, sample_count, usage) = match *shape {
|
||||
TextureShape::Texture {
|
||||
texture_type: TextureType::TextureBuffer,
|
||||
pixel_format,
|
||||
usage,
|
||||
..
|
||||
} => return buffer_fit(pixel_format, Some(usage), class),
|
||||
TextureShape::Buffer { pixel_format, .. } => return buffer_fit(pixel_format, None, class),
|
||||
TextureShape::Texture {
|
||||
texture_type,
|
||||
pixel_format,
|
||||
sample_count,
|
||||
usage,
|
||||
..
|
||||
} => (texture_type, pixel_format, sample_count, usage),
|
||||
};
|
||||
let storage = class.access == ImageAccess::Storage;
|
||||
// Metal's validation takes a write to a texture of `BlockWritesOnly` as one of `ShaderWrite`.
|
||||
@@ -309,6 +317,84 @@ pub(crate) fn fit(shape: &TextureShape, class: &ImageHandleClass) -> Fit {
|
||||
}
|
||||
}
|
||||
|
||||
/// How a texture buffer of `pixel_format` and `usage` (where its facts state one: a slot's bound
|
||||
/// texture buffer states none) fits the heap array of `class`: a texel-buffer class of its numeric
|
||||
/// type holds it where its usage has the class's access, as an image class's member's must, and
|
||||
/// one of another numeric type fits it in everything but that.
|
||||
fn buffer_fit(
|
||||
pixel_format: metal::PixelFormat,
|
||||
usage: Option<metal::TextureUsage>,
|
||||
class: &ImageHandleClass,
|
||||
) -> Fit {
|
||||
let needs = match class.access {
|
||||
ImageAccess::Storage => {
|
||||
metal::TextureUsage::SHADER_WRITE | metal::TextureUsage::BLOCK_WRITES_ONLY
|
||||
}
|
||||
_ => metal::TextureUsage::SHADER_READ,
|
||||
};
|
||||
if class.dim != ImageDim::Buffer
|
||||
|| class.arrayed
|
||||
|| class.multisampled
|
||||
|| class.depth_compare
|
||||
|| usage.is_some_and(|usage| !usage.intersects(needs))
|
||||
{
|
||||
return Fit::No;
|
||||
}
|
||||
match sampled_type(pixel_format) {
|
||||
_ if class.access == ImageAccess::Storage && writes_dropped(pixel_format) => Fit::Dropped,
|
||||
Some(t) if t == class.sampled_type => Fit::Holds,
|
||||
Some(_) => Fit::NumericType,
|
||||
None => Fit::No,
|
||||
}
|
||||
}
|
||||
|
||||
/// The format of the texel buffer view through which the texel-buffer class `class` holds a
|
||||
/// texture buffer of `pixel_format` and `swizzle` that fits it ([`buffer_fit`]): its direct
|
||||
/// format, which a uniform class's view takes as a slot's does and a storage class's formatless
|
||||
/// declaration serves for every access the device lets a heap make (`heap_storage_use`). A texel
|
||||
/// buffer view has no component mapping, so `Unsupported` for a swizzled texture buffer (a slot's
|
||||
/// read applies the swizzle in its function, a heap read does not), for a format the device views
|
||||
/// only through a converting or swizzled stand-in, and for one it cannot view for the class's
|
||||
/// usage or access without a format.
|
||||
fn member_texel_view(
|
||||
profile: &DeviceProfile,
|
||||
pixel_format: metal::PixelFormat,
|
||||
swizzle: metal::TextureSwizzleChannels,
|
||||
class: &ImageHandleClass,
|
||||
) -> Result<vk::Format, BindError> {
|
||||
if !swizzle.is_default() {
|
||||
return Err(BindError::Unsupported(Unsupported::not_implemented(
|
||||
Feature::TextureSwizzle,
|
||||
)));
|
||||
}
|
||||
let storage = class.access == ImageAccess::Storage;
|
||||
let usage = match storage {
|
||||
true => FormatUsage::StorageTexelBuffer,
|
||||
false => FormatUsage::UniformTexelBuffer,
|
||||
};
|
||||
let m = vk_format(pixel_format, &[usage].into(), profile).map_err(bind_error)?;
|
||||
if m.emulation != crate::metal::format::FormatEmulation::Direct {
|
||||
return Err(BindError::Unsupported(Unsupported::not_implemented(
|
||||
Feature::ArgumentBufferTextures,
|
||||
)));
|
||||
}
|
||||
if storage {
|
||||
let images = &profile.fields().images;
|
||||
let use_ = StorageUse::texel_buffer(
|
||||
images.storage_read_without_format,
|
||||
images.storage_write_without_format,
|
||||
);
|
||||
let gaps = without_format_gaps(m.format, use_, profile);
|
||||
if !gaps.is_empty() {
|
||||
return Err(BindError::Unsupported(Unsupported::needs_any_of(
|
||||
Feature::ArgumentBufferTextures,
|
||||
vec![gaps],
|
||||
)));
|
||||
}
|
||||
}
|
||||
Ok(m.format)
|
||||
}
|
||||
|
||||
/// Whether a member of facts `shape` is a texture a heap reads by its raw texels: an unswizzled,
|
||||
/// not sparse texture of one sample, of a form of `ExtendedRange::HEAP_READ`.
|
||||
pub(crate) fn raw_held(shape: &TextureShape) -> bool {
|
||||
@@ -517,16 +603,22 @@ fn member_view(
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum HeapElement {
|
||||
/// The array's class's neutral ([`NeutralResource::for_image`]): the texture fits another
|
||||
/// class, or no class (a texture buffer, a format the table holds no representation of).
|
||||
/// class, or no class (a format the table holds no representation of).
|
||||
Neutral,
|
||||
/// The texture, through this view.
|
||||
View(ImageViewDesc),
|
||||
/// The texture buffer, through a texel buffer view of this format over its texels, as a slot's
|
||||
/// view of it lies: from its offset (a multiple of `minTexelBufferOffsetAlignment`) over the
|
||||
/// whole texel blocks of its length, at most `maxTexelBufferElements` of them. The array is a
|
||||
/// texel-buffer class's: a uniform texel buffer array, or a storage one.
|
||||
TexelBuffer(vk::Format),
|
||||
}
|
||||
|
||||
/// What the element at a texture's resource ID of the set-1 heap array `class` holds for that
|
||||
/// texture, of `facts`, on `profile`, in `layout`, whichever command reads the ID: the
|
||||
/// texture's view where it fits the class, as a plan's member's (the module docs' **Elements**),
|
||||
/// else the class's neutral. A consumer that keeps one heap set for every command buffer (under
|
||||
/// a texture buffer's texel buffer view where it fits a texel-buffer class
|
||||
/// ([`HeapElement::TexelBuffer`]), else the class's neutral. A consumer that keeps one heap set for every command buffer (under
|
||||
/// `HeapPlacement::ResourceId`) writes every live texture's elements so, so an ID a function
|
||||
/// loads from memory reaches its texture though no command named it, as Metal's does.
|
||||
///
|
||||
@@ -550,6 +642,10 @@ pub fn heap_element(
|
||||
};
|
||||
let shape = facts.shape();
|
||||
match fit(&shape, image) {
|
||||
Fit::Holds if facts.texture_type == TextureType::TextureBuffer => {
|
||||
member_texel_view(profile, shape.pixel_format(), shape.swizzle(), image)
|
||||
.map(HeapElement::TexelBuffer)
|
||||
}
|
||||
Fit::Holds => member_view(profile, &shape, image, layout).map(HeapElement::View),
|
||||
// The float array holds its neutral, and a function's float read takes its raw texels
|
||||
// from the unsigned integer array, which views it ([`Fit::Holds`] there).
|
||||
@@ -1387,10 +1483,11 @@ impl<'a> HeapPlanner<'a> {
|
||||
}
|
||||
HandleClass::FunctionTable => return self.function_table_array(set, b),
|
||||
};
|
||||
let expected = if image.access == ImageAccess::Storage {
|
||||
vk::DescriptorType::STORAGE_IMAGE
|
||||
} else {
|
||||
vk::DescriptorType::SAMPLED_IMAGE
|
||||
let expected = match (image.access, image.dim == ImageDim::Buffer) {
|
||||
(ImageAccess::Storage, false) => vk::DescriptorType::STORAGE_IMAGE,
|
||||
(ImageAccess::Storage, true) => vk::DescriptorType::STORAGE_TEXEL_BUFFER,
|
||||
(_, false) => vk::DescriptorType::SAMPLED_IMAGE,
|
||||
(_, true) => vk::DescriptorType::UNIFORM_TEXEL_BUFFER,
|
||||
};
|
||||
if ty != expected {
|
||||
return Err(internal(format!("a heap array of {class:?} as {ty:?}")));
|
||||
|
||||
@@ -1672,3 +1672,81 @@ fn a_state_in_token_order_finds_its_members_searching_forward() {
|
||||
let elements = |state: &BindState| heap_elements(&shuffled, state, 4 * MEMBERS);
|
||||
assert_eq!(elements(&ordered).unwrap(), elements(&state).unwrap());
|
||||
}
|
||||
|
||||
/// A texture buffer fits only a texel-buffer class: the one of its numeric type holds it, where its
|
||||
/// usage has the class's access (its facts' usage; a slot's bound texture buffer states none), and
|
||||
/// one of another numeric type fits it in everything but that; no image class fits it. On every
|
||||
/// committed profile whose uniform texel buffers take `RGBA32Float`, its element in the sampled
|
||||
/// float class is a texel view of `R32G32B32A32_SFLOAT`, the neutral in the other numeric classes,
|
||||
/// and a swizzled one, whose swizzle a texel view cannot present, is `Unsupported`.
|
||||
#[test]
|
||||
fn a_texture_buffer_is_held_by_the_texel_buffer_class_of_its_numeric_type() {
|
||||
use ImageAccess::{Sampled, Storage};
|
||||
use SampledType::{Float, Uint};
|
||||
let fb = class(ImageDim::Buffer, false, false, Float, Sampled);
|
||||
let ub = class(ImageDim::Buffer, false, false, Uint, Sampled);
|
||||
let fsb = class(ImageDim::Buffer, false, false, Float, Storage);
|
||||
let f2d = class(ImageDim::D2, false, false, Float, Sampled);
|
||||
let rgba = PixelFormat::RGBA32Float;
|
||||
let bound = TextureShape::Buffer {
|
||||
pixel_format: rgba,
|
||||
swizzle: crate::metal::TextureSwizzleChannels::DEFAULT,
|
||||
};
|
||||
let read = shape(TextureType::TextureBuffer, rgba, 1, READ);
|
||||
let write = shape(TextureType::TextureBuffer, rgba, 1, WRITE);
|
||||
for s in [&bound, &read] {
|
||||
assert_eq!(fit(s, &fb), Fit::Holds);
|
||||
assert_eq!(fit(s, &ub), Fit::NumericType);
|
||||
assert_eq!(fit(s, &f2d), Fit::No);
|
||||
}
|
||||
assert_eq!(fit(&bound, &fsb), Fit::Holds);
|
||||
assert_eq!(fit(&read, &fsb), Fit::No);
|
||||
assert_eq!(fit(&write, &fsb), Fit::Holds);
|
||||
assert_eq!(fit(&write, &fb), Fit::No);
|
||||
assert_eq!(
|
||||
fit(&shape(TextureType::Type2D, rgba, 1, READ), &fb),
|
||||
Fit::No
|
||||
);
|
||||
|
||||
let layout = vk::ImageLayout::GENERAL;
|
||||
let image = HandleClass::Image;
|
||||
let mut held = 0;
|
||||
for (stem, p) in &committed_profiles().expect("profiles") {
|
||||
if !p.supports_format(
|
||||
vk::Format::R32G32B32A32_SFLOAT,
|
||||
FormatUsage::UniformTexelBuffer,
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
held += 1;
|
||||
let facts = TextureFacts::new(TextureType::TextureBuffer, rgba);
|
||||
assert_eq!(
|
||||
heap_element(p, &image(fb), &facts, layout),
|
||||
Ok(HeapElement::TexelBuffer(vk::Format::R32G32B32A32_SFLOAT)),
|
||||
"{stem}"
|
||||
);
|
||||
assert_eq!(
|
||||
heap_element(p, &image(ub), &facts, layout),
|
||||
Ok(HeapElement::Neutral),
|
||||
"{stem}"
|
||||
);
|
||||
assert_eq!(
|
||||
heap_element(p, &image(f2d), &facts, layout),
|
||||
Ok(HeapElement::Neutral),
|
||||
"{stem}"
|
||||
);
|
||||
let mut swizzled = facts;
|
||||
swizzled.swizzle.red = crate::metal::TextureSwizzle::Zero;
|
||||
assert_eq!(
|
||||
heap_element(p, &image(fb), &swizzled, layout),
|
||||
Err(BindError::Unsupported(Unsupported::not_implemented(
|
||||
Feature::TextureSwizzle
|
||||
))),
|
||||
"{stem}"
|
||||
);
|
||||
}
|
||||
assert!(
|
||||
held > 0,
|
||||
"no committed profile takes RGBA32Float texel buffers"
|
||||
);
|
||||
}
|
||||
Vendored
+1
-1
@@ -94,7 +94,7 @@ pub const ARTIFACT_FORMAT_VERSION: u32 = 523;
|
||||
/// 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 = 2341;
|
||||
pub const RUNTIME_VERSION: u32 = 2342;
|
||||
|
||||
/// 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
|
||||
|
||||
@@ -261,6 +261,12 @@ fn derive_fields(
|
||||
update_after_bind_storage_buffer: has(
|
||||
VkFeature::DescriptorBindingStorageBufferUpdateAfterBind,
|
||||
),
|
||||
update_after_bind_uniform_texel_buffer: has(
|
||||
VkFeature::DescriptorBindingUniformTexelBufferUpdateAfterBind,
|
||||
),
|
||||
update_after_bind_storage_texel_buffer: has(
|
||||
VkFeature::DescriptorBindingStorageTexelBufferUpdateAfterBind,
|
||||
),
|
||||
update_unused_while_pending: has(VkFeature::DescriptorBindingUpdateUnusedWhilePending),
|
||||
non_uniform_sampled_image: has(VkFeature::ShaderSampledImageArrayNonUniformIndexing),
|
||||
non_uniform_storage_image: has(VkFeature::ShaderStorageImageArrayNonUniformIndexing),
|
||||
|
||||
@@ -556,8 +556,9 @@ fn co_enable_violation(
|
||||
/// `features` less what the co-enable rules forbid with the rest, on a device whose
|
||||
/// `robustBufferAccessUpdateAfterBind` is `rba_update_after_bind`. Where `robustBufferAccess`
|
||||
/// meets [`BUFFER_UPDATE_AFTER_BIND`] on a device without that property, the update-after-bind
|
||||
/// features go: the core reads `robustBufferAccess` to choose the containment encoding and reads
|
||||
/// none of them, since the only update-after-bind set it lays out holds image and sampler classes.
|
||||
/// features go: the core reads `robustBufferAccess` to choose the containment encoding, and the
|
||||
/// set-1 arrays that need them (the function tables', the texel-buffer classes') are refused there,
|
||||
/// naming the feature.
|
||||
/// Then each feature whose [`FEATURE_NEEDS`] companion is missing goes; no companion is itself
|
||||
/// dropped, so one pass keeps every rule.
|
||||
fn co_enabled(
|
||||
|
||||
@@ -832,6 +832,8 @@ pub struct DescriptorCaps {
|
||||
pub update_after_bind_sampled_image: bool,
|
||||
pub update_after_bind_storage_image: bool,
|
||||
pub update_after_bind_storage_buffer: bool,
|
||||
pub update_after_bind_uniform_texel_buffer: bool,
|
||||
pub update_after_bind_storage_texel_buffer: bool,
|
||||
pub update_unused_while_pending: bool,
|
||||
pub non_uniform_sampled_image: bool,
|
||||
pub non_uniform_storage_image: bool,
|
||||
|
||||
@@ -176,8 +176,9 @@ fn recommendations_keep_robust_buffer_access_and_vuid_10247() {
|
||||
/// `robustBufferAccess` with the buffer update-after-bind features (the finding: a device made from
|
||||
/// the recommendation failed `vkCreateDevice`). Its recommendation now keeps the rule, so the
|
||||
/// stated robustness can be created; adding the buffer update-after-bind features to the restricted
|
||||
/// description changes only the profile's update-after-bind facts, which no lowering reads: the
|
||||
/// containment encoding and every other field are the same.
|
||||
/// description changes only the profile's update-after-bind facts, which only the set-1 arrays that
|
||||
/// need them read (the function tables', the texel-buffer classes'): the containment encoding and
|
||||
/// every other field are the same.
|
||||
#[test]
|
||||
fn the_swiftshader_recommendation_keeps_vuid_10247() {
|
||||
let desc = profile("swiftshader");
|
||||
@@ -201,7 +202,11 @@ fn the_swiftshader_recommendation_keeps_vuid_10247() {
|
||||
assert_eq!(both.required_enables(), rec);
|
||||
let mut fields = both.profile().fields().clone();
|
||||
assert!(fields.descriptors.update_after_bind_storage_buffer);
|
||||
assert!(fields.descriptors.update_after_bind_uniform_texel_buffer);
|
||||
assert!(fields.descriptors.update_after_bind_storage_texel_buffer);
|
||||
fields.descriptors.update_after_bind_storage_buffer = false;
|
||||
fields.descriptors.update_after_bind_uniform_texel_buffer = false;
|
||||
fields.descriptors.update_after_bind_storage_texel_buffer = false;
|
||||
for f in BUFFER_UPDATE_AFTER_BIND {
|
||||
fields.enabled.features.remove(f);
|
||||
}
|
||||
|
||||
@@ -21,8 +21,10 @@
|
||||
//! A depth texture is read through the float class of its shape, declared without `Depth`, and one
|
||||
//! compared anywhere through the depth-comparison class of its shape, declared `Depth`. A heap
|
||||
//! texture is sampled through a separate heap sampler (`lower::sampler`); a sampled cube group is a
|
||||
//! cube class when it is only sampled. Heap cube reads, writes, and queries, and heap texture
|
||||
//! buffers, are not implemented yet.
|
||||
//! cube class when it is only sampled. A texture buffer group is a texel-buffer class: a uniform
|
||||
//! texel buffer array where its members are read only, a formatless storage texel buffer array
|
||||
//! where they are written, each of its numeric type. Heap cube reads, writes, and queries are not
|
||||
//! implemented yet.
|
||||
//!
|
||||
//! **Slots** ([`SlotPlan`]). Every texture slot the function uses is declared once, as one
|
||||
//! `OpTypeImage` derived from the typed operand positions of the intrinsics that use it (the ABI
|
||||
|
||||
@@ -454,11 +454,13 @@ fn declare_heap(
|
||||
ImageDim::D1 => (Dim::D1, SymDim::D1),
|
||||
ImageDim::D2 => (Dim::D2, SymDim::D2),
|
||||
ImageDim::D3 => (Dim::D3, SymDim::D3),
|
||||
// A texture buffer group is a texel-buffer class: a uniform texel buffer array where its
|
||||
// members are read only, a formatless storage texel buffer array where they are written.
|
||||
ImageDim::Buffer => (Dim::Buffer, SymDim::Buffer),
|
||||
// A cube group that is only sampled and queried is the sampled cube class, its members
|
||||
// held through their cube views: a size, array-size, or level-count query is the cube
|
||||
// view's own, as a slot cube's is (an arrayed cube's size counts cubes). A cube read or
|
||||
// written by face is addressed through a 2D-array view, which needs its own class; texture
|
||||
// buffers need texel-buffer heap classes.
|
||||
// written by face is addressed through a 2D-array view, which needs its own class.
|
||||
ImageDim::Cube if !storage && !(h.uses.read || h.uses.write || h.uses.atomic) => {
|
||||
if shape.array && !cx.profile.fields().images.cube_array {
|
||||
return Err(Unsupported::needs(
|
||||
@@ -469,10 +471,11 @@ fn declare_heap(
|
||||
}
|
||||
(Dim::Cube, SymDim::Cube)
|
||||
}
|
||||
ImageDim::Cube | ImageDim::Buffer => {
|
||||
ImageDim::Cube => {
|
||||
return Err(Unsupported::not_implemented(Feature::ArgumentBufferTextures).into())
|
||||
}
|
||||
};
|
||||
let buffer = shape.dim == ImageDim::Buffer;
|
||||
// A depth texture read without comparison is a member of the float class of its shape: the
|
||||
// binder holds a depth texture there through its depth-aspect view (`bind::heap::fit`), whose
|
||||
// texel's first component is the depth, and the class is declared without `Depth`, an operand
|
||||
@@ -504,17 +507,28 @@ fn declare_heap(
|
||||
VkFeature::DescriptorBindingPartiallyBound,
|
||||
);
|
||||
if storage {
|
||||
need(
|
||||
d.non_uniform_storage_image,
|
||||
VkFeature::ShaderStorageImageArrayNonUniformIndexing,
|
||||
);
|
||||
need(
|
||||
d.update_after_bind_storage_image,
|
||||
VkFeature::DescriptorBindingStorageImageUpdateAfterBind,
|
||||
);
|
||||
if buffer {
|
||||
need(
|
||||
d.non_uniform_storage_texel_buffer,
|
||||
VkFeature::ShaderStorageTexelBufferArrayNonUniformIndexing,
|
||||
);
|
||||
need(
|
||||
d.update_after_bind_storage_texel_buffer,
|
||||
VkFeature::DescriptorBindingStorageTexelBufferUpdateAfterBind,
|
||||
);
|
||||
} else {
|
||||
need(
|
||||
d.non_uniform_storage_image,
|
||||
VkFeature::ShaderStorageImageArrayNonUniformIndexing,
|
||||
);
|
||||
need(
|
||||
d.update_after_bind_storage_image,
|
||||
VkFeature::DescriptorBindingStorageImageUpdateAfterBind,
|
||||
);
|
||||
}
|
||||
// A heap's storage classes are declared without a format, and the binder views its
|
||||
// members for every access the device's features grant (`bind::heap`): a device's
|
||||
// formats' own bits do not serve a heap.
|
||||
// formats' own bits do not serve a heap. The features name storage texel buffers too.
|
||||
need(
|
||||
!h.uses.read || images.storage_read_without_format,
|
||||
VkFeature::ShaderStorageImageReadWithoutFormat,
|
||||
@@ -527,6 +541,15 @@ fn declare_heap(
|
||||
!shape.ms || images.storage_multisample,
|
||||
VkFeature::ShaderStorageImageMultisample,
|
||||
);
|
||||
} else if buffer {
|
||||
need(
|
||||
d.non_uniform_uniform_texel_buffer,
|
||||
VkFeature::ShaderUniformTexelBufferArrayNonUniformIndexing,
|
||||
);
|
||||
need(
|
||||
d.update_after_bind_uniform_texel_buffer,
|
||||
VkFeature::DescriptorBindingUniformTexelBufferUpdateAfterBind,
|
||||
);
|
||||
} else {
|
||||
need(
|
||||
d.non_uniform_sampled_image,
|
||||
@@ -593,9 +616,15 @@ pub fn heap_layout_features(plan: &crate::lower::select::Plan) -> Vec<VkFeature>
|
||||
for h in plan.families.texture.heap.values() {
|
||||
let Some(class) = h.class else { continue };
|
||||
out.push(VkFeature::DescriptorBindingPartiallyBound);
|
||||
out.push(match class.access {
|
||||
ImageAccess::Storage => VkFeature::DescriptorBindingStorageImageUpdateAfterBind,
|
||||
_ => VkFeature::DescriptorBindingSampledImageUpdateAfterBind,
|
||||
out.push(match (class.access, class.dim == SymDim::Buffer) {
|
||||
(ImageAccess::Storage, false) => {
|
||||
VkFeature::DescriptorBindingStorageImageUpdateAfterBind
|
||||
}
|
||||
(ImageAccess::Storage, true) => {
|
||||
VkFeature::DescriptorBindingStorageTexelBufferUpdateAfterBind
|
||||
}
|
||||
(_, false) => VkFeature::DescriptorBindingSampledImageUpdateAfterBind,
|
||||
(_, true) => VkFeature::DescriptorBindingUniformTexelBufferUpdateAfterBind,
|
||||
});
|
||||
}
|
||||
out.sort();
|
||||
|
||||
@@ -24,7 +24,10 @@
|
||||
//! (`memory::handles::TABLE_CAPACITY`). The binder writes element 0 of each array with its
|
||||
//! class's neutral and every resident texture at its own element. The function tables' array
|
||||
//! (`HandleClass::FunctionTable`) is a storage-buffer array, which needs
|
||||
//! `descriptorBindingStorageBufferUpdateAfterBind` and counts in the storage-buffer limits.
|
||||
//! `descriptorBindingStorageBufferUpdateAfterBind` and counts in the storage-buffer limits. A
|
||||
//! texture buffer class's array is a uniform texel buffer array (sampled) or a storage texel
|
||||
//! buffer array (storage), which needs the type's update-after-bind feature and counts in the
|
||||
//! sampled-image or the storage-image limits, as Vulkan counts texel buffers.
|
||||
//! - **Specialization ids** are numbered densely in [`SpecKey`] order over the pipeline; a key two
|
||||
//! stages declare gets one id.
|
||||
//! - **Locations** ([`varyings`]) from each stage's stage-IO contract: attributes densely by index,
|
||||
@@ -1254,6 +1257,14 @@ fn heap_layout_lacks(p: &DeviceProfile, ty: vk::DescriptorType) -> Option<Vec<Vk
|
||||
d.update_after_bind_storage_buffer,
|
||||
VkFeature::DescriptorBindingStorageBufferUpdateAfterBind,
|
||||
),
|
||||
vk::DescriptorType::UNIFORM_TEXEL_BUFFER => (
|
||||
d.update_after_bind_uniform_texel_buffer,
|
||||
VkFeature::DescriptorBindingUniformTexelBufferUpdateAfterBind,
|
||||
),
|
||||
vk::DescriptorType::STORAGE_TEXEL_BUFFER => (
|
||||
d.update_after_bind_storage_texel_buffer,
|
||||
VkFeature::DescriptorBindingStorageTexelBufferUpdateAfterBind,
|
||||
),
|
||||
_ => return None,
|
||||
};
|
||||
let needs = [
|
||||
@@ -1321,9 +1332,11 @@ fn heap_capacity(
|
||||
p: &DeviceProfile,
|
||||
) -> Result<u32, Error> {
|
||||
let l = &p.fields().limits;
|
||||
// As Vulkan counts them ([`kind_counts`]): a uniform texel buffer array is sampled images, a
|
||||
// storage texel buffer array storage images.
|
||||
let kind = |ty: vk::DescriptorType| match ty {
|
||||
vk::DescriptorType::SAMPLER => SAMPLERS,
|
||||
vk::DescriptorType::STORAGE_IMAGE => IMAGES,
|
||||
vk::DescriptorType::STORAGE_IMAGE | vk::DescriptorType::STORAGE_TEXEL_BUFFER => IMAGES,
|
||||
vk::DescriptorType::STORAGE_BUFFER => STORAGE,
|
||||
_ => SAMPLED,
|
||||
};
|
||||
|
||||
@@ -0,0 +1,102 @@
|
||||
//! Texture buffers read through argument buffers: the owned fixture `abt_descriptor_sets`, in the
|
||||
//! shape SPIRV-Cross writes for descriptor sets a Vulkan layer keeps in tier-2 argument buffers,
|
||||
//! whose texel buffers are `texture_buffer` members. Such a member's handle is a set-1 element of
|
||||
//! a texel-buffer heap class (`lower::texture`'s heap handles).
|
||||
|
||||
use crate::device::{Device, DevicePolicy, VkFeature};
|
||||
use crate::error::{Capability, Error, Feature, Needs};
|
||||
use crate::library::FunctionArtifact;
|
||||
use crate::pipeline::sym::{HandleClass, ImageDim, ResourceKind};
|
||||
use crate::pipeline::testing::{
|
||||
compile, description, engine_dir, link_and_validate, llvm_assemble, AssembleError,
|
||||
};
|
||||
use crate::spirv::testing::committed_profiles;
|
||||
use crate::vk;
|
||||
|
||||
fn fixture() -> Option<Vec<u8>> {
|
||||
match llvm_assemble(&engine_dir().join("abt_descriptor_sets.ll")) {
|
||||
Ok(b) => Some(b),
|
||||
Err(AssembleError::Missing(why)) => {
|
||||
eprintln!("SKIPPED: {why}");
|
||||
None
|
||||
}
|
||||
Err(AssembleError::Rejected(why)) => panic!("llvm-as rejected the fixture: {why}"),
|
||||
}
|
||||
}
|
||||
|
||||
/// The heap arrays `a` declares: each class with its descriptor type.
|
||||
fn heap(a: &FunctionArtifact) -> Vec<(HandleClass, vk::DescriptorType)> {
|
||||
(a.interface.descriptors.iter())
|
||||
.filter_map(|d| match d.slot.kind {
|
||||
ResourceKind::Heap(class) => Some((class, d.ty)),
|
||||
_ => None,
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// `abt_frag_texel_buffer` reads a texture buffer member of its argument buffer. On every committed
|
||||
/// profile with what a uniform texel-buffer heap array needs (`runtimeDescriptorArray`,
|
||||
/// `descriptorBindingPartiallyBound`, `shaderUniformTexelBufferArrayNonUniformIndexing`,
|
||||
/// `descriptorBindingUniformTexelBufferUpdateAfterBind`) it compiles to one set-1 uniform texel
|
||||
/// buffer array of a `Buffer` class and passes L3; on one without, it is refused naming what lacks,
|
||||
/// never as not implemented. A device described without the update-after-bind feature alone is
|
||||
/// refused naming exactly it.
|
||||
#[test]
|
||||
fn a_texture_buffer_argument_is_a_texel_buffer_heap_class() {
|
||||
let Some(bc) = fixture() else {
|
||||
return;
|
||||
};
|
||||
let entry = "abt_frag_texel_buffer";
|
||||
let mut compiled = 0;
|
||||
for (stem, p) in committed_profiles().expect("profiles") {
|
||||
let d = &p.fields().descriptors;
|
||||
let held = d.runtime_descriptor_array
|
||||
&& d.partially_bound
|
||||
&& d.non_uniform_uniform_texel_buffer
|
||||
&& d.update_after_bind_uniform_texel_buffer;
|
||||
match compile(&bc, entry, &p) {
|
||||
Ok(a) => {
|
||||
assert!(held, "{stem}");
|
||||
let arrays = heap(&a);
|
||||
assert_eq!(arrays.len(), 1, "{stem}: {arrays:?}");
|
||||
assert!(
|
||||
matches!(
|
||||
arrays[0],
|
||||
(HandleClass::Image(c), vk::DescriptorType::UNIFORM_TEXEL_BUFFER)
|
||||
if c.dim == ImageDim::Buffer
|
||||
),
|
||||
"{stem}: {arrays:?}"
|
||||
);
|
||||
link_and_validate(&a, &p).unwrap_or_else(|e| panic!("{stem}: L3: {e}"));
|
||||
compiled += 1;
|
||||
}
|
||||
Err(Error::Unsupported(u)) => {
|
||||
assert!(!held, "{stem}: {u:?}");
|
||||
assert_eq!(u.feature, Feature::ArgumentBufferTextures, "{stem}");
|
||||
assert!(matches!(u.needs, Needs::AnyOf(_)), "{stem}: {u:?}");
|
||||
}
|
||||
Err(e) => panic!("{stem}: {e}"),
|
||||
}
|
||||
}
|
||||
assert!(
|
||||
compiled > 0,
|
||||
"no committed profile holds a texel-buffer heap"
|
||||
);
|
||||
|
||||
let mut desc = description("nvidia-rtx50-linux").expect("description");
|
||||
desc.features
|
||||
.remove(&VkFeature::DescriptorBindingUniformTexelBufferUpdateAfterBind);
|
||||
let device = Device::new(desc, DevicePolicy::default()).expect("device");
|
||||
match compile(&bc, entry, device.profile()) {
|
||||
Err(Error::Unsupported(u)) => {
|
||||
assert_eq!(u.feature, Feature::ArgumentBufferTextures);
|
||||
assert_eq!(
|
||||
u.needs,
|
||||
Needs::AnyOf(vec![vec![Capability::Feature(
|
||||
VkFeature::DescriptorBindingUniformTexelBufferUpdateAfterBind
|
||||
)]])
|
||||
);
|
||||
}
|
||||
other => panic!("{:?}", other.map(|_| ())),
|
||||
}
|
||||
}
|
||||
@@ -77,6 +77,7 @@ mod engine_half_storage_notes;
|
||||
mod engine_handles;
|
||||
mod engine_heap_binder;
|
||||
mod engine_heap_residency;
|
||||
mod engine_heap_texel_buffers;
|
||||
mod engine_heap_ycbcr_writes;
|
||||
mod engine_helper_picks;
|
||||
mod engine_helper_threads;
|
||||
|
||||
@@ -4509,6 +4509,8 @@ field metal2vulkan::device::DescriptorCaps.uniform_buffer_standard_layout pub un
|
||||
field metal2vulkan::device::DescriptorCaps.update_after_bind_sampled_image pub update_after_bind_sampled_image: bool
|
||||
field metal2vulkan::device::DescriptorCaps.update_after_bind_storage_buffer pub update_after_bind_storage_buffer: bool
|
||||
field metal2vulkan::device::DescriptorCaps.update_after_bind_storage_image pub update_after_bind_storage_image: bool
|
||||
field metal2vulkan::device::DescriptorCaps.update_after_bind_storage_texel_buffer pub update_after_bind_storage_texel_buffer: bool
|
||||
field metal2vulkan::device::DescriptorCaps.update_after_bind_uniform_texel_buffer pub update_after_bind_uniform_texel_buffer: bool
|
||||
field metal2vulkan::device::DescriptorCaps.update_unused_while_pending pub update_unused_while_pending: bool
|
||||
field metal2vulkan::device::DescriptorCaps.variable_descriptor_count pub variable_descriptor_count: bool
|
||||
field metal2vulkan::device::DeviceDescription.allocation pub allocation: AllocationLimits
|
||||
@@ -13427,6 +13429,7 @@ variant metal2vulkan::bind::GeneratedRefusal::TokenOffset TokenOffset { offset:
|
||||
variant metal2vulkan::bind::GeneratedRefusal::Unmatched Unmatched { index: usize }
|
||||
variant metal2vulkan::bind::GeneratedRefusal::Variants Variants { registered: usize, generated: usize }
|
||||
variant metal2vulkan::bind::HeapElement::Neutral Neutral
|
||||
variant metal2vulkan::bind::HeapElement::TexelBuffer TexelBuffer(vk::Format)
|
||||
variant metal2vulkan::bind::HeapElement::View View(ImageViewDesc)
|
||||
variant metal2vulkan::bind::HeapPlacement::Planned Planned
|
||||
variant metal2vulkan::bind::HeapPlacement::ResourceId ResourceId
|
||||
|
||||
|
Can't render this file because it is too large.
|
+14
-3
@@ -1377,7 +1377,14 @@ for dependency in &pipeline.dependencies {
|
||||
there.
|
||||
- The layout numbers set 0 densely, in `ResourceSlot` order. Set 1 holds the heap arrays (the
|
||||
resources reached through argument buffers and resource IDs); `pipeline::heap_sampler_capacity`
|
||||
is the most elements a set-1 sampler array has on a profile. Push constants carry the values the
|
||||
is the most elements a set-1 sampler array has on a profile. A texture buffer reached so is an
|
||||
element of a texel-buffer class: a uniform texel buffer array where the function only reads it,
|
||||
a storage texel buffer array declared without a format where it writes it, each needing the
|
||||
texel buffer kind's non-uniform indexing and update-after-bind features (a storage one also
|
||||
`shaderStorageImage{Read,Write}WithoutFormat`). `bind::heap_element` answers
|
||||
`HeapElement::TexelBuffer` for a texture buffer such a class holds, the format of its texel
|
||||
buffer view; a planned heap's members are textures with images, so only a heap set the consumer
|
||||
keeps for every command (each live texture at its resource ID) holds texture buffers. Push constants carry the values the
|
||||
binder writes per command. A stage that writes the command buffer's `ExecutionStatus` (an absent
|
||||
argument's read, a `seq_cst` fence, an argument buffer's cubic sampler) reaches it by device
|
||||
address, a push hole, where the device addresses buffers (`bufferDeviceAddress` and
|
||||
@@ -3218,8 +3225,12 @@ bound.
|
||||
texture that a heap array's class fits, but whose format the array cannot view (one the device
|
||||
cannot sample, or store without a format, or one whose raw texels need its function's decode): the
|
||||
device's heap set holds the class's neutral at its ID, which a command that names the texture
|
||||
refuses instead. Cost: a function reading the texture through its ID, in a command that does not
|
||||
name it (bind it, or make it resident), reads the neutral texture where Metal's reads the texture.
|
||||
refuses instead. A texture buffer that a texel-buffer class fits but no texel view of its bytes in
|
||||
place reaches (one viewed through a staging buffer or its tail, at an offset off
|
||||
`minTexelBufferOffsetAlignment`, or of more texels than `maxTexelBufferElements`), or whose
|
||||
swizzle or format a texel view cannot present, is the class's neutral there too, named or not.
|
||||
Cost: a function reading the texture through its ID, in a command that does not name it (bind
|
||||
it, or make it resident), reads the neutral texture where Metal's reads the texture.
|
||||
- `metal2vulkan-degrade-unnamed-shadowed-texture` (precision). `UnnamedShadowedTexture`: A shadowed
|
||||
texture in the device's heap set. Cost: a function reading the texture through its ID, in a
|
||||
command that does not name it, reads the texels an encoder that named it last copied in (undefined
|
||||
|
||||
+4
-4
@@ -77,7 +77,7 @@ Columns:
|
||||
| `QuadOperations` | Quad operations in a stage without quad support | devices without VkLimit::MinSubgroupSize; devices without VkProperty::SubgroupQuadOperationsInAllStages | `device` | 2: `crates/metal2vulkan/src/device/subgroup.rs (subgroup_tier, 2 sites)` | `app`: quad shuffles in kernels on devices without quad operations there |
|
||||
| `SimdgroupMatrix` | Simdgroup matrix operations | every device (not implemented) | `ours` | 1: `crates/metal2vulkan/src/lower/simd/matrix.rs (not_implemented)` | `rare`: simdgroup matrix kernels |
|
||||
| `ArgumentBufferPointers` | Argument buffers holding buffer pointers (dynamic roots) | devices without buffer device addresses (`addressed_needs`) | `device` | 1: `crates/metal2vulkan/src/device/metal.rs (unsupported_features)` | `app`: argument buffers holding buffer pointers |
|
||||
| `ArgumentBufferTextures` | Argument buffers holding textures or samplers (handle domain) | devices short of a device limit the site names; devices without a capability the site computes (`gaps`); devices without a capability the site computes (`missing`); devices without a capability the site computes (`needs`); every device (not implemented) | `ours` | 18: `crates/metal2vulkan-runtime/src/families/features.rs (tier2)`, `crates/metal2vulkan-runtime/src/pipeline/objects.rs (create_set_layout)` (+10) | `app`: argument buffers holding textures and samplers (bindless) |
|
||||
| `ArgumentBufferTextures` | Argument buffers holding textures or samplers (handle domain) | devices short of a device limit the site names; devices without a capability the site computes (`gaps`); devices without a capability the site computes (`missing`); devices without a capability the site computes (`needs`); every device (not implemented) | `ours` | 20: `crates/metal2vulkan-runtime/src/families/features.rs (tier2)`, `crates/metal2vulkan-runtime/src/pipeline/objects.rs (create_set_layout)` (+11) | `app`: argument buffers holding textures and samplers (bindless) |
|
||||
| `ArgumentBufferObjects` | Argument-buffer members that are pipeline states, ICBs, function tables, or acceleration structures | every device (not implemented) | `ours` | 5: `crates/metal2vulkan/src/lower/access/encode.rs (select_command, 3 sites)`, `crates/metal2vulkan/src/memory/provenance.rs (access)` (+1) | `rare`: pipeline states and ICBs in argument buffers |
|
||||
| `DereferenceLoadedPointer` | Dereferencing a pointer loaded from memory or made from an integer | devices short of a Vulkan feature the site names; devices without buffer device addresses (`addressed_needs`); every device (no Vulkan mechanism) | `device` | 4: `crates/metal2vulkan/src/lower/access/dynamic.rs (plan_misses)`, `crates/metal2vulkan/src/lower/access/local.rs (access_ptr)` (+2) | `app`: pointers loaded from argument buffers |
|
||||
| `PointerToInteger` | Storing a pointer or converting it to an integer | - | `-` | via a helper: 1: `crates/metal2vulkan/src/lower/access/dynamic.rs (require_addresses)` | `rare`: pointer to integer casts |
|
||||
@@ -160,7 +160,7 @@ Columns:
|
||||
| `TextureSize` | A texture whose extent, array layers, or level count is past what the device takes for its format, type, and usage (`Capability::Limit` names the... | devices short of a device limit the site names | `device` | 1: `crates/metal2vulkan-runtime/src/image_plan.rs (check_image_limits)` | `app`: a texture past a device's image limits |
|
||||
| `TextureSampleCount` | A texture sample count the device does not take for its format, type, and usage | devices short of a Vulkan property the site names; devices without VkFeature::MultisampleArrayImage; every device (no Vulkan mechanism) | `device` | 3: `crates/metal2vulkan-runtime/src/image_plan.rs (check_image_limits)`, `crates/metal2vulkan-runtime/src/image_plan.rs (plan_held, 2 sites)` | `app`: a sample count a device lacks for the texture |
|
||||
| `TextureView` | A texture view Vulkan cannot make exactly on this image | every device (no Vulkan mechanism); every device (not implemented) | `ours` | 9: `crates/metal2vulkan-runtime/src/binding_view.rs (binding_view)`, `crates/metal2vulkan-runtime/src/texture.rs (view_as)` (+6) | `app`: a texture view Vulkan cannot make exactly |
|
||||
| `TextureSwizzle` | A texture swizzle whose Metal behavior is not measured | devices short of a Vulkan feature the site names; every device (not implemented) | `ours` | 7: `crates/metal2vulkan-runtime/src/binding_view.rs (binding_view)`, `crates/metal2vulkan-runtime/src/texture.rs (may_view)` (+5) | `app`: texture swizzles whose Metal behaviour is unmeasured |
|
||||
| `TextureSwizzle` | A texture swizzle whose Metal behavior is not measured | devices short of a Vulkan feature the site names; every device (not implemented) | `ours` | 8: `crates/metal2vulkan-runtime/src/binding_view.rs (binding_view)`, `crates/metal2vulkan-runtime/src/texture.rs (may_view)` (+6) | `app`: texture swizzles whose Metal behaviour is unmeasured |
|
||||
| `MipmapGeneration` | `generateMipmapsForTexture:` that cannot run on the device | devices without a format's usage; every device (not implemented) | `ours` | 7: `crates/metal2vulkan-runtime/src/blit_texture.rs (mipmaps)`, `crates/metal2vulkan-runtime/src/mipmap_pick.rs (new)` (+3) | `app`: generateMipmapsForTexture: of a format or chain neither the device's blits nor the compute filter can run |
|
||||
| `HostMemory` | A buffer over the caller's host memory without a copy (`newBufferWithBytesNoCopy:`) | devices without VkExtension::ExtExternalMemoryHost; drivers with defect UnpinnablePagesBreakHostMemory; every device (no Vulkan mechanism); every device (not implemented) | `ours` | 8: `crates/metal2vulkan-runtime/src/host_memory.rs (new, 3 sites)`, `crates/metal2vulkan-runtime/src/host_memory.rs (no_pointer_refusal)` (+4) | `system`: newBufferWithBytesNoCopy: where the device cannot import the memory |
|
||||
| `GpuTimes` | A command buffer's GPU times (`GPUStartTime`, `GPUEndTime`) on a device whose queue family writes no timestamps (`timestampValidBits` 0) | every device (no Vulkan mechanism) | `device` | 1: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (gpu_times)` | `rare`: GPU times on a queue without timestamps |
|
||||
@@ -609,7 +609,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::QuadOperations`: `crates/metal2vulkan/src/device/subgroup.rs (subgroup_tier, 2 sites)`
|
||||
- `feature::SimdgroupMatrix`: `crates/metal2vulkan/src/lower/simd/matrix.rs (not_implemented)`
|
||||
- `feature::ArgumentBufferPointers`: `crates/metal2vulkan/src/device/metal.rs (unsupported_features)`
|
||||
- `feature::ArgumentBufferTextures`: `crates/metal2vulkan-runtime/src/families/features.rs (tier2)`; `crates/metal2vulkan-runtime/src/pipeline/objects.rs (create_set_layout)`; `crates/metal2vulkan-runtime/src/resource_ids.rs (check_capacity, 2 sites)`; `crates/metal2vulkan/src/bind/heap.rs (array)`; `crates/metal2vulkan/src/bind/heap.rs (member_view, 5 sites)`; `crates/metal2vulkan/src/bind/heap.rs (new)`; `crates/metal2vulkan/src/lower/access/handle.rs (select)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_sampling)`; `crates/metal2vulkan/src/lower/texture/atomic.rs (select)`; `crates/metal2vulkan/src/lower/texture/slot.rs (declare_heap, 2 sites)`; `crates/metal2vulkan/src/pipeline/link.rs (heap_set)`
|
||||
- `feature::ArgumentBufferTextures`: `crates/metal2vulkan-runtime/src/families/features.rs (tier2)`; `crates/metal2vulkan-runtime/src/pipeline/objects.rs (create_set_layout)`; `crates/metal2vulkan-runtime/src/resource_ids.rs (check_capacity, 2 sites)`; `crates/metal2vulkan/src/bind/heap.rs (array)`; `crates/metal2vulkan/src/bind/heap.rs (member_texel_view, 2 sites)`; `crates/metal2vulkan/src/bind/heap.rs (member_view, 5 sites)`; `crates/metal2vulkan/src/bind/heap.rs (new)`; `crates/metal2vulkan/src/lower/access/handle.rs (select)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_sampling)`; `crates/metal2vulkan/src/lower/texture/atomic.rs (select)`; `crates/metal2vulkan/src/lower/texture/slot.rs (declare_heap, 2 sites)`; `crates/metal2vulkan/src/pipeline/link.rs (heap_set)`
|
||||
- `feature::ArgumentBufferObjects`: `crates/metal2vulkan/src/lower/access/encode.rs (select_command, 3 sites)`; `crates/metal2vulkan/src/memory/provenance.rs (access)`; `crates/metal2vulkan/src/memory/provenance.rs (classify)`
|
||||
- `feature::DereferenceLoadedPointer`: `crates/metal2vulkan/src/lower/access/dynamic.rs (plan_misses)`; `crates/metal2vulkan/src/lower/access/local.rs (access_ptr)`; `crates/metal2vulkan/src/lower/access/local.rs (threadgroup_constant_refusal)`; `crates/metal2vulkan/src/memory/plan.rs (analyze)`
|
||||
- `feature::PointerToInteger`: `crates/metal2vulkan/src/lower/access/dynamic.rs (require_addresses)`
|
||||
@@ -692,7 +692,7 @@ Each refusal's sites, with the function that builds it.
|
||||
- `feature::TextureSize`: `crates/metal2vulkan-runtime/src/image_plan.rs (check_image_limits)`
|
||||
- `feature::TextureSampleCount`: `crates/metal2vulkan-runtime/src/image_plan.rs (check_image_limits)`; `crates/metal2vulkan-runtime/src/image_plan.rs (plan_held, 2 sites)`
|
||||
- `feature::TextureView`: `crates/metal2vulkan-runtime/src/binding_view.rs (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs (view_as)`; `crates/metal2vulkan-runtime/src/texture/decoded_twin.rs (make_second_twin)`; `crates/metal2vulkan-runtime/src/texture/view_shadow.rs (apart_refusal)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs (converted_view)`; `crates/metal2vulkan-runtime/src/texture/ycbcr_image.rs (luma_view)`; `crates/metal2vulkan-runtime/src/view_plan.rs (check_format)`; `crates/metal2vulkan-runtime/src/view_plan.rs (check_view, 2 sites)`
|
||||
- `feature::TextureSwizzle`: `crates/metal2vulkan-runtime/src/binding_view.rs (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs (may_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs (select)`
|
||||
- `feature::TextureSwizzle`: `crates/metal2vulkan-runtime/src/binding_view.rs (binding_view)`; `crates/metal2vulkan-runtime/src/texture.rs (may_view)`; `crates/metal2vulkan/src/bind/heap.rs (member_texel_view)`; `crates/metal2vulkan/src/bind/plan/resources.rs (plain_texture)`; `crates/metal2vulkan/src/lower/sampler/select.rs (select_one)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_read_as)`; `crates/metal2vulkan/src/lower/texture/mod.rs (select_write)`; `crates/metal2vulkan/src/lower/texture/slice.rs (select)`
|
||||
- `feature::MipmapGeneration`: `crates/metal2vulkan-runtime/src/blit_texture.rs (mipmaps)`; `crates/metal2vulkan-runtime/src/mipmap_pick.rs (new)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs (blit_lack, 2 sites)`; `crates/metal2vulkan-runtime/src/mipmap_plan.rs (plan_mipmaps, 2 sites)`; `crates/metal2vulkan-runtime/src/shadow.rs (run)`
|
||||
- `feature::HostMemory`: `crates/metal2vulkan-runtime/src/host_memory.rs (new, 3 sites)`; `crates/metal2vulkan-runtime/src/host_memory.rs (no_pointer_refusal)`; `crates/metal2vulkan-runtime/src/host_memory.rs (not_importable)`; `crates/metal2vulkan-runtime/src/host_memory.rs (refuse_unwritable)`; `crates/metal2vulkan-runtime/src/host_memory.rs (unpinnable)`; `crates/metal2vulkan-runtime/src/host_ram.rs (new)`
|
||||
- `feature::GpuTimes`: `crates/metal2vulkan-runtime/src/command_buffer/mod.rs (gpu_times)`
|
||||
|
||||
Reference in new issue
Block a user