--wip-- [skip ci]

This commit is contained in:
2025-07-01 17:36:10 +01:00
parent 33d8a95eea
commit 7f89bc4d62
9 changed files with 581 additions and 446 deletions
Generated
+12 -12
View File
@@ -4,9 +4,9 @@ version = 4
[[package]]
name = "ab_glyph"
version = "0.2.29"
version = "0.2.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec3672c180e71eeaaac3a541fbbc5f5ad4def8b747c595ad30d674e43049f7b0"
checksum = "1e0f4f6fbdc5ee39f2ede9f5f3ec79477271a6d6a2baff22310d51736bda6cea"
dependencies = [
"ab_glyph_rasterizer",
"owned_ttf_parser",
@@ -14,9 +14,9 @@ dependencies = [
[[package]]
name = "ab_glyph_rasterizer"
version = "0.1.8"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046"
checksum = "b2187590a23ab1e3df8681afdf0987c48504d80291f002fcdb651f0ef5e25169"
[[package]]
name = "adler2"
@@ -87,9 +87,9 @@ checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223"
[[package]]
name = "arboard"
version = "3.5.0"
version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c1df21f715862ede32a0c525ce2ca4d52626bb0007f8c18b87a384503ac33e70"
checksum = "55f533f8e0af236ffe5eb979b99381df3258853f00ba2e44b6e1955292c75227"
dependencies = [
"clipboard-win",
"image",
@@ -458,9 +458,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28"
[[package]]
name = "crunchy"
version = "0.2.3"
version = "0.2.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929"
checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5"
[[package]]
name = "cursor-icon"
@@ -1009,9 +1009,9 @@ checksum = "d0263a3d970d5c054ed9312c0057b4f3bde9c0b33836d3637361d4a9e6e7a408"
[[package]]
name = "indexmap"
version = "2.9.0"
version = "2.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661"
dependencies = [
"equivalent",
"hashbrown",
@@ -1125,9 +1125,9 @@ dependencies = [
[[package]]
name = "libredox"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d"
checksum = "1580801010e535496706ba011c15f8532df6b42297d2e471fec38ceadd8c0638"
dependencies = [
"bitflags 2.9.1",
"libc",
+3 -4
View File
@@ -1,7 +1,6 @@
glslangValidator -g0 -S frag --target-env vulkan1.4 src/trace.frag.glsl
spirv-dis --no-color frag.spv > src/trace.spv-dis
sed -i '/%18 =/,/OpFunctionEnd/d' src/trace.spv-dis
sed -i 's/%18\b/%1000/g' src/trace.spv-dis
glslangValidator --spirv-val --spirv-dis -g0 -S frag --target-env vulkan1.4 --quiet src/trace.frag.glsl > src/trace.spv-dis
#sed -i '/%11 =/,/OpFunctionEnd/d' src/trace.spv-dis
#sed -i 's/%11\b/%1000/g' src/trace.spv-dis
spirv-as --preserve-numeric-ids --target-env vulkan1.4 -o src/recompiled.spv src/trace.spv-dis
rm frag.spv
# rm src/trace.spv-dis
+26
View File
@@ -0,0 +1,26 @@
#version 460
#extension GL_GOOGLE_include_directive:require
#include "include.glsl"
layout(input_attachment_index = 0, set = 1, binding = 0) uniform subpassInput u_color;
layout(input_attachment_index = 1, set = 1, binding = 1) uniform subpassInput u_normals;
layout(location = 0) out vec4 f_color;
vec3 shading(vec3 normal, vec4 position)
{
vec3 accum = vec3(0., 0., 0.);
mat3 rotation = mat3(pc.world[0].xyz, pc.world[1].xyz, pc.world[2].xyz);
//vec3 position=pc.world[3].xyz;
for (int i = 0; (i < light_uniforms.light_count) && (i < 32); i++)
{
accum += light_uniforms.col[i].xyz * ((dot(normalize(rotation * normal), normalize(light_uniforms.pos[i].xyz - position.xyz)) * .5) + .5);
}
return accum;
}
void main() {
f_color = vec4(subpassLoad(u_color).rgb, 1.0);
}
+9
View File
@@ -0,0 +1,9 @@
#version 460
#extension GL_GOOGLE_include_directive:require
#include "include.glsl"
const vec2 full_screen_triangle[3] = {vec2(-1., -1.), vec2(1., -1.), vec2(-1., 1.)};
void main() {
gl_Position = vec4(full_screen_triangle[gl_VertexIndex], 0.0, 1.0);
}
+229 -34
View File
@@ -64,7 +64,7 @@ use vulkano::{
input_assembly::InputAssemblyState,
multisample::MultisampleState,
rasterization::{CullMode, FrontFace, PolygonMode, RasterizationState},
vertex_input::{Vertex, VertexDefinition},
vertex_input::{Vertex, VertexDefinition, VertexInputState},
viewport::{Viewport, ViewportState},
},
layout::PipelineDescriptorSetLayoutCreateInfo,
@@ -198,6 +198,8 @@ struct App {
struct ShaderModules {
implicit_vs: Arc<ShaderModule>,
implicit_fs: Arc<ShaderModule>,
lighting_vs: Arc<ShaderModule>,
lighting_fs: Arc<ShaderModule>,
}
struct RenderContext {
@@ -205,8 +207,11 @@ struct RenderContext {
swapchain: Arc<Swapchain>,
render_pass: Arc<RenderPass>,
framebuffers: Vec<Arc<Framebuffer>>,
color_buffer: Arc<ImageView>,
normal_buffer: Arc<ImageView>,
shader_modules: ShaderModules,
implicit_pipeline: Arc<GraphicsPipeline>,
lighting_pipeline: Arc<GraphicsPipeline>,
viewport: Viewport,
recreate_swapchain: bool,
recreate_pipelines: bool,
@@ -579,10 +584,20 @@ mod implicit_vs {
}
}
mod implicit_fs {
mod lighting_vs {
vulkano_shaders::shader! {
ty: "vertex",
path: "src/lighting.vert.glsl",
vulkan_version: "1.3",
spirv_version: "1.6",
custom_derives: [Debug, Clone, Copy],
}
}
mod lighting_fs {
vulkano_shaders::shader! {
ty: "fragment",
path: "src/trace.frag.glsl",
path: "src/lighting.frag.glsl",
vulkan_version: "1.3",
spirv_version: "1.6",
custom_derives: [Debug, Clone, Copy],
@@ -682,7 +697,14 @@ impl ApplicationHandler for App {
::std::sync::Arc<::vulkano::shader::ShaderModule>,
::vulkano::Validated<::vulkano::VulkanError>,
>),
((implicit_fs::load)
((lighting_vs::load)
as fn(
::std::sync::Arc<::vulkano::device::Device>,
) -> Result<
::std::sync::Arc<::vulkano::shader::ShaderModule>,
::vulkano::Validated<::vulkano::VulkanError>,
>),
((lighting_fs::load)
as fn(
::std::sync::Arc<::vulkano::device::Device>,
) -> Result<
@@ -726,6 +748,8 @@ impl ApplicationHandler for App {
let shader_modules = ShaderModules {
implicit_vs: pariter[0].clone(),
implicit_fs: smodule,
lighting_vs: pariter[1].clone(),
lighting_fs: pariter[2].clone(),
};
drop(pariter);
@@ -733,12 +757,24 @@ impl ApplicationHandler for App {
let render_pass = vulkano::ordered_passes_renderpass!(
self.device.clone(),
attachments: {
color: {
final_color: {
format: swapchain.image_format(),
samples: 1,
load_op: Clear,
store_op: Store,
},
color: {
format: Format::A2B10G10R10_UNORM_PACK32,
samples: 1,
load_op: Clear,
store_op: DontCare,
},
normals: {
format: Format::R16G16B16A16_SFLOAT,
samples: 1,
load_op: Clear,
store_op: DontCare,
},
depth: {
format: Format::D16_UNORM,
samples: 1,
@@ -747,11 +783,17 @@ impl ApplicationHandler for App {
},
},
passes: [{
color: [color],
color: [color, normals],
depth_stencil: {depth},
input: [],
},{
color: [color],
},
{
color: [final_color],
depth_stencil: {},
input: [color, normals],
},
{
color: [final_color],
depth_stencil: {},
input: [],
}]
@@ -764,9 +806,10 @@ impl ApplicationHandler for App {
depth_range: 0.0..=1.0,
};
let framebuffers = framebuffer_generation(&images, &render_pass, &self.memory_allocator);
let (framebuffers, color_buffer, normal_buffer) =
framebuffer_generation(&images, &render_pass, &self.memory_allocator);
let implicit_pipeline = pipeline_recompile(
let (implicit_pipeline, lighting_pipeline) = deferred_pipeline_recompile(
&render_pass,
&self.pipeline_cache,
&shader_modules,
@@ -781,7 +824,7 @@ impl ApplicationHandler for App {
event_loop,
surface.clone(),
self.graphics_queue.clone(),
Subpass::from(render_pass.clone(), 1).unwrap(),
Subpass::from(render_pass.clone(), 2).unwrap(),
images[0].format(),
GuiConfig {
allow_srgb_render_target: true,
@@ -795,8 +838,11 @@ impl ApplicationHandler for App {
swapchain,
render_pass,
framebuffers,
color_buffer,
normal_buffer,
shader_modules,
implicit_pipeline,
lighting_pipeline,
viewport,
recreate_swapchain: false,
recreate_pipelines: false,
@@ -945,7 +991,7 @@ impl App {
.expect("Failed to recreate swapchain");
rcx.swapchain = new_swapchain;
rcx.framebuffers =
(rcx.framebuffers, rcx.color_buffer, rcx.normal_buffer) =
framebuffer_generation(&new_images, &rcx.render_pass, &self.memory_allocator);
rcx.viewport.extent[0] = window_size.width as f32;
@@ -991,7 +1037,7 @@ impl App {
}
if rcx.recreate_pipelines {
rcx.implicit_pipeline = pipeline_recompile(
(rcx.implicit_pipeline, rcx.lighting_pipeline) = deferred_pipeline_recompile(
&rcx.render_pass,
&self.pipeline_cache,
&rcx.shader_modules,
@@ -1115,10 +1161,26 @@ impl App {
sub
};
assert!(rcx.implicit_pipeline.layout().set_layouts().len() == 1);
let implicit_layout = &rcx.implicit_pipeline.layout().set_layouts()[0];
let implicit_set = DescriptorSet::new(
self.descriptor_set_allocator.clone(),
implicit_layout.clone(),
[
//WriteDescriptorSet::buffer(0, uniform_buffer_subbuffer.clone()),
WriteDescriptorSet::buffer(1, cam_set.clone()),
],
[],
)
.unwrap();
assert!(rcx.lighting_pipeline.layout().set_layouts().len() == 2);
let lighting_layout1 = &rcx.lighting_pipeline.layout().set_layouts()[0];
let lighting_set1 = DescriptorSet::new(
self.descriptor_set_allocator.clone(),
lighting_layout1.clone(),
[
WriteDescriptorSet::buffer(0, uniform_buffer_subbuffer.clone()),
WriteDescriptorSet::buffer(1, cam_set.clone()),
@@ -1127,6 +1189,18 @@ impl App {
)
.unwrap();
let lighting_layout2 = &rcx.lighting_pipeline.layout().set_layouts()[1];
let lighting_set2 = DescriptorSet::new(
self.descriptor_set_allocator.clone(),
lighting_layout2.clone(),
[
WriteDescriptorSet::image_view(0, rcx.color_buffer.clone()),
WriteDescriptorSet::image_view(1, rcx.normal_buffer.clone()),
],
[],
)
.unwrap();
let (image_index, suboptimal, acquire_future) =
match acquire_next_image(rcx.swapchain.clone(), None).map_err(Validated::unwrap) {
Ok(r) => r,
@@ -1161,7 +1235,12 @@ impl App {
builder
.begin_render_pass(
RenderPassBeginInfo {
clear_values: vec![Some([0.12, 0.1, 0.1, 1.0].into()), Some(1.0.into())],
clear_values: vec![
Some([0.0, 0.0, 0.0, 1.0].into()),
Some([0.12, 0.1, 0.1, 1.0].into()),
Some([0.0, 0.0, 0.0, 1.0].into()),
Some(1.0.into()),
],
..RenderPassBeginInfo::framebuffer(
rcx.framebuffers[image_index as usize].clone(),
)
@@ -1214,6 +1293,27 @@ impl App {
}
}
builder
.next_subpass(
Default::default(),
SubpassBeginInfo {
contents: SubpassContents::Inline,
..Default::default()
},
)
.unwrap();
builder
.bind_pipeline_graphics(rcx.lighting_pipeline.clone())
.unwrap()
.bind_descriptor_sets(
PipelineBindPoint::Graphics,
rcx.lighting_pipeline.layout().clone(),
0,
vec![lighting_set1, lighting_set2],
)
.unwrap();
builder
.next_subpass(
Default::default(),
@@ -1268,7 +1368,7 @@ fn framebuffer_generation(
images: &[Arc<Image>],
render_pass: &Arc<RenderPass>,
allocator: &Arc<StandardMemoryAllocator>,
) -> Vec<Arc<Framebuffer>> {
) -> (Vec<Arc<Framebuffer>>, Arc<ImageView>, Arc<ImageView>) {
let depth_buffer = ImageView::new_default(
Image::new(
allocator.clone(),
@@ -1285,16 +1385,55 @@ fn framebuffer_generation(
)
.unwrap();
let color_buffer = ImageView::new_default(
Image::new(
allocator.clone(),
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Format::A2B10G10R10_UNORM_PACK32,
extent: images[0].extent(),
usage: ImageUsage::COLOR_ATTACHMENT
| ImageUsage::INPUT_ATTACHMENT
| ImageUsage::TRANSIENT_ATTACHMENT,
..Default::default()
},
AllocationCreateInfo::default(),
)
.unwrap(),
)
.unwrap();
let normal_buffer = ImageView::new_default(
Image::new(
allocator.clone(),
ImageCreateInfo {
image_type: ImageType::Dim2d,
format: Format::R16G16B16A16_SFLOAT,
extent: images[0].extent(),
usage: ImageUsage::COLOR_ATTACHMENT
| ImageUsage::INPUT_ATTACHMENT
| ImageUsage::TRANSIENT_ATTACHMENT,
..Default::default()
},
AllocationCreateInfo::default(),
)
.unwrap(),
)
.unwrap();
let framebuffers = images
.iter()
.map(|image| {
let view = ImageView::new_default(image.clone()).unwrap();
Framebuffer::new(
render_pass.clone(),
FramebufferCreateInfo {
attachments: vec![view, depth_buffer.clone()],
attachments: vec![
view,
color_buffer.clone(),
normal_buffer.clone(),
depth_buffer.clone(),
],
..Default::default()
},
)
@@ -1302,16 +1441,16 @@ fn framebuffer_generation(
})
.collect::<Vec<_>>();
framebuffers
(framebuffers, color_buffer, normal_buffer)
}
fn pipeline_recompile(
fn deferred_pipeline_recompile(
render_pass: &Arc<RenderPass>,
cache: &Arc<PipelineCache>,
shader_modules: &ShaderModules,
debug: &PreviousDebug,
viewport: Option<&Viewport>,
) -> Arc<GraphicsPipeline> {
) -> (Arc<GraphicsPipeline>, Arc<GraphicsPipeline>) {
let device = cache.device();
const SPEC_BOUNDING_BOXES: u32 = 0;
@@ -1403,11 +1542,74 @@ fn pipeline_recompile(
let stages = [implicit_vs_info, implicit_fs_info].into_iter().collect();
let subpass = Subpass::from(render_pass.clone(), 0).unwrap();
let deferred_subpass = Subpass::from(render_pass.clone(), 0).unwrap();
let render_start = Instant::now();
let implicit_pipeline = {
GraphicsPipeline::new(
device.clone(),
Some(cache.clone()),
GraphicsPipelineCreateInfo {
flags: PipelineCreateFlags::DISABLE_OPTIMIZATION,
stages,
vertex_input_state: Some(vertex_input_state),
input_assembly_state: Some(InputAssemblyState::default()),
dynamic_state: dynamic_state.clone(),
viewport_state: Some(viewport_state.clone()),
rasterization_state: Some(RasterizationState {
front_face: FrontFace::Clockwise,
cull_mode: CullMode::Back,
polygon_mode: PolygonMode::Fill,
..RasterizationState::default()
}),
depth_stencil_state: Some(DepthStencilState {
depth: Some(DepthState::simple()),
..Default::default()
}),
multisample_state: Some(MultisampleState::default()),
color_blend_state: Some(ColorBlendState::with_attachment_states(
deferred_subpass.num_color_attachments(),
ColorBlendAttachmentState::default(),
)),
subpass: Some(deferred_subpass.into()),
..GraphicsPipelineCreateInfo::layout(layout.clone())
},
)
.unwrap()
};
let lighting_vs_entry = shader_modules
.lighting_vs
.specialize(specs.clone())
.unwrap()
.single_entry_point()
.unwrap();
let vertex_input_state = VertexInputState::new();
let lighting_vs_info = PipelineShaderStageCreateInfo::new(lighting_vs_entry);
let lighting_fs_info = PipelineShaderStageCreateInfo::new(
shader_modules
.lighting_fs
.specialize(specs.clone())
.unwrap()
.single_entry_point()
.unwrap(),
);
let layout = PipelineLayout::new(
device.clone(),
PipelineDescriptorSetLayoutCreateInfo::from_stages([&lighting_vs_info, &lighting_fs_info])
.into_pipeline_layout_create_info(device.clone())
.unwrap(),
)
.unwrap();
let stages = [lighting_vs_info, lighting_fs_info].into_iter().collect();
let lighting_subpass = Subpass::from(render_pass.clone(), 1).unwrap();
let lighting_pipeline = {
GraphicsPipeline::new(
device.clone(),
Some(cache.clone()),
@@ -1424,20 +1626,13 @@ fn pipeline_recompile(
polygon_mode: PolygonMode::Fill,
..RasterizationState::default()
}),
depth_stencil_state: Some(DepthStencilState {
depth: Some(DepthState::simple()),
..Default::default()
}),
multisample_state: Some(MultisampleState {
rasterization_samples: subpass.num_samples().unwrap(),
sample_shading: SAMPLE_RATE_SHADING,
..Default::default()
}),
depth_stencil_state: None,
multisample_state: Some(MultisampleState::default()),
color_blend_state: Some(ColorBlendState::with_attachment_states(
subpass.num_color_attachments(),
lighting_subpass.num_color_attachments(),
ColorBlendAttachmentState::default(),
)),
subpass: Some(subpass.into()),
subpass: Some(lighting_subpass.into()),
..GraphicsPipelineCreateInfo::layout(layout.clone())
},
)
@@ -1454,7 +1649,7 @@ fn pipeline_recompile(
dump_pipeline_cache(cache.clone());
implicit_pipeline
(implicit_pipeline, lighting_pipeline)
}
fn gpu_buffer<T>(
Binary file not shown.
+1 -1
View File
@@ -480,7 +480,7 @@ impl SSATape {
let vec4 = b.type_vector(float, 4);
let vec3p = b.type_pointer(None, spirv::StorageClass::Function, vec3);
let scene_fn_type = if with_module {
16
9
} else {
b.type_function(float, vec![vec3p])
};
+5 -17
View File
@@ -9,21 +9,7 @@ layout(location = 0) in vec4 pos;
layout(depth_greater) out float gl_FragDepth;
layout(location = 0) out vec4 f_color;
/// SHARED CODE ///
vec3 shading(vec3 normal, vec4 position)
{
vec3 accum = vec3(0., 0., 0.);
mat3 rotation = mat3(pc.world[0].xyz, pc.world[1].xyz, pc.world[2].xyz);
//vec3 position=pc.world[3].xyz;
for (int i = 0; (i < light_uniforms.light_count) && (i < 32); i++)
{
accum += light_uniforms.col[i].xyz * ((dot(normalize(rotation * normal), normalize(light_uniforms.pos[i].xyz - position.xyz)) * .5) + .5);
}
return accum;
}
layout(location = 1) out vec4 f_normal;
float scene(vec3 p) {
return length(p) - 1.0;
@@ -69,10 +55,12 @@ void main() {
if (td.y < EPSILON)
{
vec3 n = getNormal(p, td.y);
f_color = vec4(shading(n, inverse(pc.world) * vec4(p, 1.)), 1.);
f_color = vec4(0.5, 0.5, 0.5, 1.0);
f_normal = vec4(n, 1.0);
vec4 tpoint = camera_uniforms.proj * camera_uniforms.view * pc.world * vec4(p, 1);
// gl_FragDepth = (tpoint.z / tpoint.w);
gl_FragDepth = (tpoint.z / tpoint.w);
}
else
{
+296 -378
View File
@@ -1,431 +1,349 @@
; SPIR-V
; Version: 1.6
; Generator: Khronos Glslang Reference Front End; 11
; Bound: 341
; Bound: 260
; Schema: 0
OpCapability Shader
%1 = OpExtInstImport "GLSL.std.450"
OpMemoryModel Logical GLSL450
OpEntryPoint Fragment %4 "main" %34 %41 %97 %257 %268 %302 %gl_FragDepth
OpEntryPoint Fragment %4 "main" %27 %35 %171 %182 %217 %220 %gl_FragDepth %259
OpExecutionMode %4 OriginUpperLeft
OpExecutionMode %4 DepthReplacing
OpExecutionMode %4 DepthGreater
OpDecorate %_arr_uint_uint_16 ArrayStride 4
OpDecorate %_struct_39 Block
OpMemberDecorate %_struct_39 0 ColMajor
OpMemberDecorate %_struct_39 0 MatrixStride 16
OpMemberDecorate %_struct_39 0 Offset 0
OpMemberDecorate %_struct_39 1 Offset 64
OpMemberDecorate %_struct_39 2 Offset 80
OpMemberDecorate %_struct_39 3 Offset 92
OpDecorate %_struct_33 Block
OpMemberDecorate %_struct_33 0 ColMajor
OpMemberDecorate %_struct_33 0 MatrixStride 16
OpMemberDecorate %_struct_33 0 Offset 0
OpMemberDecorate %_struct_33 1 Offset 64
OpMemberDecorate %_struct_33 2 Offset 80
OpMemberDecorate %_struct_33 3 Offset 92
OpDecorate %171 Location 0
OpDecorate %_struct_180 Block
OpMemberDecorate %_struct_180 0 ColMajor
OpMemberDecorate %_struct_180 0 MatrixStride 16
OpMemberDecorate %_struct_180 0 Offset 0
OpMemberDecorate %_struct_180 1 ColMajor
OpMemberDecorate %_struct_180 1 MatrixStride 16
OpMemberDecorate %_struct_180 1 Offset 64
OpMemberDecorate %_struct_180 2 Offset 128
OpDecorate %182 Binding 1
OpDecorate %182 DescriptorSet 0
OpDecorate %217 Location 0
OpDecorate %220 Location 1
OpDecorate %gl_FragDepth BuiltIn FragDepth
OpDecorate %_arr_v4float_uint_32 ArrayStride 16
OpDecorate %_arr_v4float_uint_32_0 ArrayStride 16
OpDecorate %_struct_95 Block
OpMemberDecorate %_struct_95 0 Offset 0
OpMemberDecorate %_struct_95 1 Offset 512
OpMemberDecorate %_struct_95 2 Offset 1024
OpDecorate %97 Binding 0
OpDecorate %97 DescriptorSet 0
OpDecorate %257 Location 0
OpDecorate %_struct_266 Block
OpMemberDecorate %_struct_266 0 ColMajor
OpMemberDecorate %_struct_266 0 MatrixStride 16
OpMemberDecorate %_struct_266 0 Offset 0
OpMemberDecorate %_struct_266 1 ColMajor
OpMemberDecorate %_struct_266 1 MatrixStride 16
OpMemberDecorate %_struct_266 1 Offset 64
OpMemberDecorate %_struct_266 2 Offset 128
OpDecorate %268 Binding 1
OpDecorate %268 DescriptorSet 0
OpDecorate %302 Location 0
OpDecorate %gl_FragDepth BuiltIn FragDepth
OpDecorate %_struct_257 Block
OpMemberDecorate %_struct_257 0 Offset 0
OpMemberDecorate %_struct_257 1 Offset 512
OpMemberDecorate %_struct_257 2 Offset 1024
OpDecorate %259 Binding 0
OpDecorate %259 DescriptorSet 0
%void = OpTypeVoid
%3 = OpTypeFunction %void
%float = OpTypeFloat 32
%v3float = OpTypeVector %float 3
%_ptr_Function_v3float = OpTypePointer Function %v3float
%v4float = OpTypeVector %float 4
%_ptr_Function_v4float = OpTypePointer Function %v4float
%11 = OpTypeFunction %v3float %_ptr_Function_v3float %_ptr_Function_v4float
%16 = OpTypeFunction %float %_ptr_Function_v3float
%9 = OpTypeFunction %float %_ptr_Function_v3float
%_ptr_Function_float = OpTypePointer Function %float
%21 = OpTypeFunction %v3float %_ptr_Function_v3float %_ptr_Function_float
%14 = OpTypeFunction %v3float %_ptr_Function_v3float %_ptr_Function_float
%v2float = OpTypeVector %float 2
%27 = OpTypeFunction %v2float %_ptr_Function_v3float %_ptr_Function_v3float %_ptr_Function_v3float
%20 = OpTypeFunction %v2float %_ptr_Function_v3float %_ptr_Function_v3float %_ptr_Function_v3float
%_ptr_Private_float = OpTypePointer Private %float
%34 = OpVariable %_ptr_Private_float Private
%27 = OpVariable %_ptr_Private_float Private
%v4float = OpTypeVector %float 4
%mat4v4float = OpTypeMatrix %v4float 4
%uint = OpTypeInt 32 0
%uint_16 = OpConstant %uint 16
%_arr_uint_uint_16 = OpTypeArray %uint %uint_16
%_struct_39 = OpTypeStruct %mat4v4float %v3float %v3float %_arr_uint_uint_16
%_ptr_PushConstant__struct_39 = OpTypePointer PushConstant %_struct_39
%41 = OpVariable %_ptr_PushConstant__struct_39 PushConstant
%_struct_33 = OpTypeStruct %mat4v4float %v3float %v3float %_arr_uint_uint_16
%_ptr_PushConstant__struct_33 = OpTypePointer PushConstant %_struct_33
%35 = OpVariable %_ptr_PushConstant__struct_33 PushConstant
%int = OpTypeInt 32 1
%int_1 = OpConstant %int 1
%_ptr_PushConstant_v3float = OpTypePointer PushConstant %v3float
%float_8 = OpConstant %float 8
%float_0 = OpConstant %float 0
%53 = OpConstantComposite %v3float %float_0 %float_0 %float_0
%mat3v3float = OpTypeMatrix %v3float 3
%_ptr_Function_mat3v3float = OpTypePointer Function %mat3v3float
%int_0 = OpConstant %int 0
%_ptr_PushConstant_v4float = OpTypePointer PushConstant %v4float
%int_2 = OpConstant %int 2
%float_1 = OpConstant %float 1
%_ptr_Function_int = OpTypePointer Function %int
%uint_32 = OpConstant %uint 32
%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32
%_arr_v4float_uint_32_0 = OpTypeArray %v4float %uint_32
%_struct_95 = OpTypeStruct %_arr_v4float_uint_32 %_arr_v4float_uint_32_0 %uint
%_ptr_Uniform__struct_95 = OpTypePointer Uniform %_struct_95
%97 = OpVariable %_ptr_Uniform__struct_95 Uniform
%_ptr_Uniform_uint = OpTypePointer Uniform %uint
%bool = OpTypeBool
%int_32 = OpConstant %int 32
%_ptr_Uniform_v4float = OpTypePointer Uniform %v4float
%float_0_5 = OpConstant %float 0.5
%uint_0 = OpConstant %uint 0
%float_9_99999975en05 = OpConstant %float 9.99999975e-05
%uint_1 = OpConstant %uint 1
%uint_2 = OpConstant %uint 2
%_ptr_Function_v2float = OpTypePointer Function %v2float
%190 = OpConstantComposite %v2float %float_0 %float_1
%float_0 = OpConstant %float 0
%101 = OpConstantComposite %v2float %float_0 %float_1
%float_0_899999976 = OpConstant %float 0.899999976
%_ptr_Function_int = OpTypePointer Function %int
%int_0 = OpConstant %int 0
%bool = OpTypeBool
%uint_50 = OpConstant %uint 50
%_ptr_Input_v4float = OpTypePointer Input %v4float
%257 = OpVariable %_ptr_Input_v4float Input
%171 = OpVariable %_ptr_Input_v4float Input
%_ptr_PushConstant_mat4v4float = OpTypePointer PushConstant %mat4v4float
%_struct_266 = OpTypeStruct %mat4v4float %mat4v4float %v3float
%_ptr_Uniform__struct_266 = OpTypePointer Uniform %_struct_266
%268 = OpVariable %_ptr_Uniform__struct_266 Uniform
%_struct_180 = OpTypeStruct %mat4v4float %mat4v4float %v3float
%_ptr_Uniform__struct_180 = OpTypePointer Uniform %_struct_180
%182 = OpVariable %_ptr_Uniform__struct_180 Uniform
%int_2 = OpConstant %int 2
%_ptr_Uniform_v3float = OpTypePointer Uniform %v3float
%_ptr_Output_v4float = OpTypePointer Output %v4float
%302 = OpVariable %_ptr_Output_v4float Output
%217 = OpVariable %_ptr_Output_v4float Output
%float_0_5 = OpConstant %float 0.5
%219 = OpConstantComposite %v4float %float_0_5 %float_0_5 %float_0_5 %float_1
%220 = OpVariable %_ptr_Output_v4float Output
%_ptr_Function_v4float = OpTypePointer Function %v4float
%_ptr_Uniform_mat4v4float = OpTypePointer Uniform %mat4v4float
%_ptr_Output_float = OpTypePointer Output %float
%gl_FragDepth = OpVariable %_ptr_Output_float Output
%uint_3 = OpConstant %uint 3
%uint_32 = OpConstant %uint 32
%_arr_v4float_uint_32 = OpTypeArray %v4float %uint_32
%_arr_v4float_uint_32_0 = OpTypeArray %v4float %uint_32
%_struct_257 = OpTypeStruct %_arr_v4float_uint_32 %_arr_v4float_uint_32_0 %uint
%_ptr_Uniform__struct_257 = OpTypePointer Uniform %_struct_257
%259 = OpVariable %_ptr_Uniform__struct_257 Uniform
%4 = OpFunction %void None %3
%5 = OpLabel
%255 = OpVariable %_ptr_Function_v3float Function
%260 = OpVariable %_ptr_Function_v3float Function
%280 = OpVariable %_ptr_Function_v2float Function
%281 = OpVariable %_ptr_Function_v3float Function
%282 = OpVariable %_ptr_Function_v3float Function
%284 = OpVariable %_ptr_Function_v3float Function
%286 = OpVariable %_ptr_Function_v3float Function
%294 = OpVariable %_ptr_Function_v3float Function
%295 = OpVariable %_ptr_Function_v3float Function
%297 = OpVariable %_ptr_Function_float Function
%312 = OpVariable %_ptr_Function_v3float Function
%314 = OpVariable %_ptr_Function_v4float Function
%320 = OpVariable %_ptr_Function_v4float Function
%45 = OpAccessChain %_ptr_PushConstant_v3float %41 %int_1
%46 = OpLoad %v3float %45
%48 = OpCompositeConstruct %v3float %float_8 %float_8 %float_8
%49 = OpFDiv %v3float %46 %48
%50 = OpExtInst %float %1 Length %49
OpStore %34 %50
%258 = OpLoad %v4float %257
%259 = OpVectorShuffle %v3float %258 %258 0 1 2
OpStore %255 %259
%261 = OpLoad %v3float %255
%263 = OpAccessChain %_ptr_PushConstant_mat4v4float %41 %int_0
%264 = OpLoad %mat4v4float %263
%265 = OpExtInst %mat4v4float %1 MatrixInverse %264
%270 = OpAccessChain %_ptr_Uniform_v3float %268 %int_2
%271 = OpLoad %v3float %270
%272 = OpCompositeExtract %float %271 0
%273 = OpCompositeExtract %float %271 1
%274 = OpCompositeExtract %float %271 2
%275 = OpCompositeConstruct %v4float %272 %273 %274 %float_1
%276 = OpMatrixTimesVector %v4float %265 %275
%277 = OpVectorShuffle %v3float %276 %276 0 1 2
%278 = OpFSub %v3float %261 %277
%279 = OpExtInst %v3float %1 Normalize %278
OpStore %260 %279
%283 = OpLoad %v3float %255
OpStore %282 %283
%285 = OpLoad %v3float %260
OpStore %284 %285
%287 = OpFunctionCall %v2float %31 %282 %284 %286
%288 = OpLoad %v3float %286
OpStore %281 %288
OpStore %280 %287
%289 = OpAccessChain %_ptr_Function_float %280 %uint_1
%290 = OpLoad %float %289
%291 = OpFOrdLessThan %bool %290 %float_9_99999975en05
OpSelectionMerge %293 None
OpBranchConditional %291 %292 %336
%292 = OpLabel
%296 = OpLoad %v3float %281
OpStore %295 %296
%298 = OpAccessChain %_ptr_Function_float %280 %uint_1
%299 = OpLoad %float %298
OpStore %297 %299
%300 = OpFunctionCall %v3float %24 %295 %297
OpStore %294 %300
%303 = OpAccessChain %_ptr_PushConstant_mat4v4float %41 %int_0
%304 = OpLoad %mat4v4float %303
%305 = OpExtInst %mat4v4float %1 MatrixInverse %304
%306 = OpLoad %v3float %281
%307 = OpCompositeExtract %float %306 0
%308 = OpCompositeExtract %float %306 1
%309 = OpCompositeExtract %float %306 2
%310 = OpCompositeConstruct %v4float %307 %308 %309 %float_1
%311 = OpMatrixTimesVector %v4float %305 %310
%313 = OpLoad %v3float %294
OpStore %312 %313
OpStore %314 %311
%315 = OpFunctionCall %v3float %14 %312 %314
%316 = OpCompositeExtract %float %315 0
%317 = OpCompositeExtract %float %315 1
%318 = OpCompositeExtract %float %315 2
%319 = OpCompositeConstruct %v4float %316 %317 %318 %float_1
OpStore %302 %319
%322 = OpAccessChain %_ptr_Uniform_mat4v4float %268 %int_1
%323 = OpLoad %mat4v4float %322
%324 = OpAccessChain %_ptr_Uniform_mat4v4float %268 %int_0
%325 = OpLoad %mat4v4float %324
%326 = OpMatrixTimesMatrix %mat4v4float %323 %325
%327 = OpAccessChain %_ptr_PushConstant_mat4v4float %41 %int_0
%328 = OpLoad %mat4v4float %327
%329 = OpMatrixTimesMatrix %mat4v4float %326 %328
%330 = OpLoad %v3float %281
%331 = OpCompositeExtract %float %330 0
%332 = OpCompositeExtract %float %330 1
%333 = OpCompositeExtract %float %330 2
%334 = OpCompositeConstruct %v4float %331 %332 %333 %float_1
%335 = OpMatrixTimesVector %v4float %329 %334
OpStore %320 %335
OpBranch %293
%336 = OpLabel
%169 = OpVariable %_ptr_Function_v3float Function
%174 = OpVariable %_ptr_Function_v3float Function
%195 = OpVariable %_ptr_Function_v2float Function
%196 = OpVariable %_ptr_Function_v3float Function
%197 = OpVariable %_ptr_Function_v3float Function
%199 = OpVariable %_ptr_Function_v3float Function
%201 = OpVariable %_ptr_Function_v3float Function
%209 = OpVariable %_ptr_Function_v3float Function
%210 = OpVariable %_ptr_Function_v3float Function
%212 = OpVariable %_ptr_Function_float Function
%227 = OpVariable %_ptr_Function_v4float Function
%39 = OpAccessChain %_ptr_PushConstant_v3float %35 %int_1
%40 = OpLoad %v3float %39
%42 = OpCompositeConstruct %v3float %float_8 %float_8 %float_8
%43 = OpFDiv %v3float %40 %42
%44 = OpExtInst %float %1 Length %43
OpStore %27 %44
%172 = OpLoad %v4float %171
%173 = OpVectorShuffle %v3float %172 %172 0 1 2
OpStore %169 %173
%175 = OpLoad %v3float %169
%177 = OpAccessChain %_ptr_PushConstant_mat4v4float %35 %int_0
%178 = OpLoad %mat4v4float %177
%179 = OpExtInst %mat4v4float %1 MatrixInverse %178
%185 = OpAccessChain %_ptr_Uniform_v3float %182 %int_2
%186 = OpLoad %v3float %185
%187 = OpCompositeExtract %float %186 0
%188 = OpCompositeExtract %float %186 1
%189 = OpCompositeExtract %float %186 2
%190 = OpCompositeConstruct %v4float %187 %188 %189 %float_1
%191 = OpMatrixTimesVector %v4float %179 %190
%192 = OpVectorShuffle %v3float %191 %191 0 1 2
%193 = OpFSub %v3float %175 %192
%194 = OpExtInst %v3float %1 Normalize %193
OpStore %174 %194
%198 = OpLoad %v3float %169
OpStore %197 %198
%200 = OpLoad %v3float %174
OpStore %199 %200
%202 = OpFunctionCall %v2float %24 %197 %199 %201
%203 = OpLoad %v3float %201
OpStore %196 %203
OpStore %195 %202
%204 = OpAccessChain %_ptr_Function_float %195 %uint_1
%205 = OpLoad %float %204
%206 = OpFOrdLessThan %bool %205 %float_9_99999975en05
OpSelectionMerge %208 None
OpBranchConditional %206 %207 %251
%207 = OpLabel
%211 = OpLoad %v3float %196
OpStore %210 %211
%213 = OpAccessChain %_ptr_Function_float %195 %uint_1
%214 = OpLoad %float %213
OpStore %212 %214
%215 = OpFunctionCall %v3float %17 %210 %212
OpStore %209 %215
OpStore %217 %219
%221 = OpLoad %v3float %209
%222 = OpCompositeExtract %float %221 0
%223 = OpCompositeExtract %float %221 1
%224 = OpCompositeExtract %float %221 2
%225 = OpCompositeConstruct %v4float %222 %223 %224 %float_1
OpStore %220 %225
%229 = OpAccessChain %_ptr_Uniform_mat4v4float %182 %int_1
%230 = OpLoad %mat4v4float %229
%231 = OpAccessChain %_ptr_Uniform_mat4v4float %182 %int_0
%232 = OpLoad %mat4v4float %231
%233 = OpMatrixTimesMatrix %mat4v4float %230 %232
%234 = OpAccessChain %_ptr_PushConstant_mat4v4float %35 %int_0
%235 = OpLoad %mat4v4float %234
%236 = OpMatrixTimesMatrix %mat4v4float %233 %235
%237 = OpLoad %v3float %196
%238 = OpCompositeExtract %float %237 0
%239 = OpCompositeExtract %float %237 1
%240 = OpCompositeExtract %float %237 2
%241 = OpCompositeConstruct %v4float %238 %239 %240 %float_1
%242 = OpMatrixTimesVector %v4float %236 %241
OpStore %227 %242
%245 = OpAccessChain %_ptr_Function_float %227 %uint_2
%246 = OpLoad %float %245
%248 = OpAccessChain %_ptr_Function_float %227 %uint_3
%249 = OpLoad %float %248
%250 = OpFDiv %float %246 %249
OpStore %gl_FragDepth %250
OpBranch %208
%251 = OpLabel
OpTerminateInvocation
%293 = OpLabel
%208 = OpLabel
OpReturn
OpFunctionEnd
%14 = OpFunction %v3float None %11
%12 = OpFunctionParameter %_ptr_Function_v3float
%13 = OpFunctionParameter %_ptr_Function_v4float
%15 = OpLabel
%11 = OpFunction %float None %9
%10 = OpFunctionParameter %_ptr_Function_v3float
%12 = OpLabel
%45 = OpLoad %v3float %10
%46 = OpExtInst %float %1 Length %45
%48 = OpFSub %float %46 %float_1
OpReturnValue %48
OpFunctionEnd
%17 = OpFunction %v3float None %14
%15 = OpFunctionParameter %_ptr_Function_v3float
%16 = OpFunctionParameter %_ptr_Function_float
%18 = OpLabel
%51 = OpVariable %_ptr_Function_v3float Function
%56 = OpVariable %_ptr_Function_mat3v3float Function
%84 = OpVariable %_ptr_Function_int Function
OpStore %51 %53
%59 = OpAccessChain %_ptr_PushConstant_v4float %41 %int_0 %int_0
%60 = OpLoad %v4float %59
%61 = OpVectorShuffle %v3float %60 %60 0 1 2
%62 = OpAccessChain %_ptr_PushConstant_v4float %41 %int_0 %int_1
%63 = OpLoad %v4float %62
%64 = OpVectorShuffle %v3float %63 %63 0 1 2
%66 = OpAccessChain %_ptr_PushConstant_v4float %41 %int_0 %int_2
%67 = OpLoad %v4float %66
%68 = OpVectorShuffle %v3float %67 %67 0 1 2
%70 = OpCompositeExtract %float %61 0
%71 = OpCompositeExtract %float %61 1
%72 = OpCompositeExtract %float %61 2
%73 = OpCompositeExtract %float %64 0
%74 = OpCompositeExtract %float %64 1
%75 = OpCompositeExtract %float %64 2
%76 = OpCompositeExtract %float %68 0
%77 = OpCompositeExtract %float %68 1
%78 = OpCompositeExtract %float %68 2
%79 = OpCompositeConstruct %v3float %70 %71 %72
%80 = OpCompositeConstruct %v3float %73 %74 %75
%81 = OpCompositeConstruct %v3float %76 %77 %78
%82 = OpCompositeConstruct %mat3v3float %79 %80 %81
OpStore %56 %82
OpStore %84 %int_0
OpBranch %85
%85 = OpLabel
OpLoopMerge %87 %88 None
OpBranch %89
%89 = OpLabel
%90 = OpLoad %int %84
%91 = OpBitcast %uint %90
%99 = OpAccessChain %_ptr_Uniform_uint %97 %int_2
%100 = OpLoad %uint %99
%102 = OpULessThan %bool %91 %100
%103 = OpLoad %int %84
%105 = OpSLessThan %bool %103 %int_32
%106 = OpLogicalAnd %bool %102 %105
OpBranchConditional %106 %86 %87
%86 = OpLabel
%107 = OpLoad %int %84
%109 = OpAccessChain %_ptr_Uniform_v4float %97 %int_1 %107
%110 = OpLoad %v4float %109
%111 = OpVectorShuffle %v3float %110 %110 0 1 2
%112 = OpLoad %mat3v3float %56
%113 = OpLoad %v3float %12
%114 = OpMatrixTimesVector %v3float %112 %113
%115 = OpExtInst %v3float %1 Normalize %114
%116 = OpLoad %int %84
%117 = OpAccessChain %_ptr_Uniform_v4float %97 %int_0 %116
%118 = OpLoad %v4float %117
%119 = OpVectorShuffle %v3float %118 %118 0 1 2
%120 = OpLoad %v4float %13
%121 = OpVectorShuffle %v3float %120 %120 0 1 2
%122 = OpFSub %v3float %119 %121
%123 = OpExtInst %v3float %1 Normalize %122
%124 = OpDot %float %115 %123
%126 = OpFMul %float %124 %float_0_5
%127 = OpFAdd %float %126 %float_0_5
%128 = OpVectorTimesScalar %v3float %111 %127
%129 = OpLoad %v3float %51
%130 = OpFAdd %v3float %129 %128
OpStore %51 %130
OpBranch %88
%88 = OpLabel
%131 = OpLoad %int %84
%132 = OpIAdd %int %131 %int_1
OpStore %84 %132
OpBranch %85
%87 = OpLabel
%133 = OpLoad %v3float %51
OpReturnValue %133
%64 = OpVariable %_ptr_Function_v3float Function
%75 = OpVariable %_ptr_Function_v3float Function
%86 = OpVariable %_ptr_Function_v3float Function
%90 = OpVariable %_ptr_Function_v3float Function
%53 = OpAccessChain %_ptr_Function_float %15 %uint_0
%54 = OpLoad %float %53
%56 = OpFAdd %float %54 %float_9_99999975en05
%58 = OpAccessChain %_ptr_Function_float %15 %uint_1
%59 = OpLoad %float %58
%61 = OpAccessChain %_ptr_Function_float %15 %uint_2
%62 = OpLoad %float %61
%63 = OpCompositeConstruct %v3float %56 %59 %62
OpStore %64 %63
%65 = OpFunctionCall %float %11 %64
%66 = OpAccessChain %_ptr_Function_float %51 %uint_0
OpStore %66 %65
%67 = OpAccessChain %_ptr_Function_float %15 %uint_0
%68 = OpLoad %float %67
%69 = OpAccessChain %_ptr_Function_float %15 %uint_1
%70 = OpLoad %float %69
%71 = OpFAdd %float %70 %float_9_99999975en05
%72 = OpAccessChain %_ptr_Function_float %15 %uint_2
%73 = OpLoad %float %72
%74 = OpCompositeConstruct %v3float %68 %71 %73
OpStore %75 %74
%76 = OpFunctionCall %float %11 %75
%77 = OpAccessChain %_ptr_Function_float %51 %uint_1
OpStore %77 %76
%78 = OpAccessChain %_ptr_Function_float %15 %uint_0
%79 = OpLoad %float %78
%80 = OpAccessChain %_ptr_Function_float %15 %uint_1
%81 = OpLoad %float %80
%82 = OpAccessChain %_ptr_Function_float %15 %uint_2
%83 = OpLoad %float %82
%84 = OpFAdd %float %83 %float_9_99999975en05
%85 = OpCompositeConstruct %v3float %79 %81 %84
OpStore %86 %85
%87 = OpFunctionCall %float %11 %86
%88 = OpAccessChain %_ptr_Function_float %51 %uint_2
OpStore %88 %87
%89 = OpLoad %v3float %51
%91 = OpLoad %v3float %15
OpStore %90 %91
%92 = OpFunctionCall %float %11 %90
%93 = OpCompositeConstruct %v3float %92 %92 %92
%94 = OpFSub %v3float %89 %93
%95 = OpExtInst %v3float %1 Normalize %94
OpReturnValue %95
OpFunctionEnd
%24 = OpFunction %v3float None %21
%24 = OpFunction %v2float None %20
%21 = OpFunctionParameter %_ptr_Function_v3float
%22 = OpFunctionParameter %_ptr_Function_v3float
%23 = OpFunctionParameter %_ptr_Function_float
%23 = OpFunctionParameter %_ptr_Function_v3float
%25 = OpLabel
%141 = OpVariable %_ptr_Function_v3float Function
%154 = OpVariable %_ptr_Function_v3float Function
%165 = OpVariable %_ptr_Function_v3float Function
%176 = OpVariable %_ptr_Function_v3float Function
%180 = OpVariable %_ptr_Function_v3float Function
%143 = OpAccessChain %_ptr_Function_float %22 %uint_0
%144 = OpLoad %float %143
%146 = OpFAdd %float %144 %float_9_99999975en05
%148 = OpAccessChain %_ptr_Function_float %22 %uint_1
%149 = OpLoad %float %148
%151 = OpAccessChain %_ptr_Function_float %22 %uint_2
%152 = OpLoad %float %151
%153 = OpCompositeConstruct %v3float %146 %149 %152
OpStore %154 %153
%155 = OpFunctionCall %float %1000 %154
%156 = OpAccessChain %_ptr_Function_float %141 %uint_0
OpStore %156 %155
%157 = OpAccessChain %_ptr_Function_float %22 %uint_0
%158 = OpLoad %float %157
%159 = OpAccessChain %_ptr_Function_float %22 %uint_1
%160 = OpLoad %float %159
%161 = OpFAdd %float %160 %float_9_99999975en05
%162 = OpAccessChain %_ptr_Function_float %22 %uint_2
%163 = OpLoad %float %162
%164 = OpCompositeConstruct %v3float %158 %161 %163
OpStore %165 %164
%166 = OpFunctionCall %float %1000 %165
%167 = OpAccessChain %_ptr_Function_float %141 %uint_1
OpStore %167 %166
%168 = OpAccessChain %_ptr_Function_float %22 %uint_0
%169 = OpLoad %float %168
%170 = OpAccessChain %_ptr_Function_float %22 %uint_1
%171 = OpLoad %float %170
%172 = OpAccessChain %_ptr_Function_float %22 %uint_2
%173 = OpLoad %float %172
%174 = OpFAdd %float %173 %float_9_99999975en05
%175 = OpCompositeConstruct %v3float %169 %171 %174
OpStore %176 %175
%177 = OpFunctionCall %float %1000 %176
%178 = OpAccessChain %_ptr_Function_float %141 %uint_2
OpStore %178 %177
%179 = OpLoad %v3float %141
%181 = OpLoad %v3float %22
OpStore %180 %181
%182 = OpFunctionCall %float %1000 %180
%183 = OpCompositeConstruct %v3float %182 %182 %182
%184 = OpFSub %v3float %179 %183
%185 = OpExtInst %v3float %1 Normalize %184
OpReturnValue %185
OpFunctionEnd
%31 = OpFunction %v2float None %27
%28 = OpFunctionParameter %_ptr_Function_v3float
%29 = OpFunctionParameter %_ptr_Function_v3float
%30 = OpFunctionParameter %_ptr_Function_v3float
%32 = OpLabel
%189 = OpVariable %_ptr_Function_v2float Function
%192 = OpVariable %_ptr_Function_v3float Function
%210 = OpVariable %_ptr_Function_int Function
%233 = OpVariable %_ptr_Function_v3float Function
OpStore %189 %190
%191 = OpLoad %v3float %28
OpStore %30 %191
%193 = OpLoad %v3float %30
OpStore %192 %193
%194 = OpFunctionCall %float %1000 %192
%196 = OpFMul %float %194 %float_0_899999976
%197 = OpAccessChain %_ptr_Function_float %189 %uint_1
OpStore %197 %196
%198 = OpAccessChain %_ptr_Function_float %189 %uint_1
%199 = OpLoad %float %198
%200 = OpAccessChain %_ptr_Function_float %189 %uint_0
%201 = OpLoad %float %200
%202 = OpFAdd %float %201 %199
%203 = OpAccessChain %_ptr_Function_float %189 %uint_0
OpStore %203 %202
%204 = OpLoad %v3float %28
%205 = OpLoad %v3float %29
%206 = OpAccessChain %_ptr_Function_float %189 %uint_0
%207 = OpLoad %float %206
%208 = OpVectorTimesScalar %v3float %205 %207
%209 = OpFAdd %v3float %204 %208
OpStore %30 %209
OpStore %210 %int_0
OpBranch %211
%211 = OpLabel
OpLoopMerge %213 %214 None
OpBranch %215
%215 = OpLabel
%216 = OpLoad %int %210
%217 = OpBitcast %uint %216
%219 = OpULessThan %bool %217 %uint_50
OpSelectionMerge %221 None
OpBranchConditional %219 %220 %221
%220 = OpLabel
%222 = OpAccessChain %_ptr_Function_float %189 %uint_1
%223 = OpLoad %float %222
%224 = OpFOrdGreaterThan %bool %223 %float_9_99999975en05
OpBranch %221
%221 = OpLabel
%225 = OpPhi %bool %219 %215 %224 %220
OpSelectionMerge %227 None
OpBranchConditional %225 %226 %227
%226 = OpLabel
%228 = OpAccessChain %_ptr_Function_float %189 %uint_0
%229 = OpLoad %float %228
%230 = OpLoad %float %34
%231 = OpFOrdLessThan %bool %229 %230
OpBranch %227
%227 = OpLabel
%232 = OpPhi %bool %225 %221 %231 %226
OpBranchConditional %232 %212 %213
%212 = OpLabel
%234 = OpLoad %v3float %30
OpStore %233 %234
%235 = OpFunctionCall %float %1000 %233
%236 = OpFMul %float %235 %float_0_899999976
%237 = OpAccessChain %_ptr_Function_float %189 %uint_1
OpStore %237 %236
%238 = OpAccessChain %_ptr_Function_float %189 %uint_1
%239 = OpLoad %float %238
%240 = OpAccessChain %_ptr_Function_float %189 %uint_0
%241 = OpLoad %float %240
%242 = OpFAdd %float %241 %239
%243 = OpAccessChain %_ptr_Function_float %189 %uint_0
OpStore %243 %242
%244 = OpLoad %v3float %28
%245 = OpLoad %v3float %29
%246 = OpAccessChain %_ptr_Function_float %189 %uint_0
%247 = OpLoad %float %246
%248 = OpVectorTimesScalar %v3float %245 %247
%249 = OpFAdd %v3float %244 %248
OpStore %30 %249
OpBranch %214
%214 = OpLabel
%250 = OpLoad %int %210
%251 = OpIAdd %int %250 %int_1
OpStore %210 %251
OpBranch %211
%213 = OpLabel
%252 = OpLoad %v2float %189
OpReturnValue %252
%99 = OpVariable %_ptr_Function_v2float Function
%103 = OpVariable %_ptr_Function_v3float Function
%122 = OpVariable %_ptr_Function_int Function
%147 = OpVariable %_ptr_Function_v3float Function
OpStore %99 %101
%102 = OpLoad %v3float %21
OpStore %23 %102
%104 = OpLoad %v3float %23
OpStore %103 %104
%105 = OpFunctionCall %float %11 %103
%107 = OpFMul %float %105 %float_0_899999976
%108 = OpAccessChain %_ptr_Function_float %99 %uint_1
OpStore %108 %107
%109 = OpAccessChain %_ptr_Function_float %99 %uint_1
%110 = OpLoad %float %109
%111 = OpAccessChain %_ptr_Function_float %99 %uint_0
%112 = OpLoad %float %111
%113 = OpFAdd %float %112 %110
%114 = OpAccessChain %_ptr_Function_float %99 %uint_0
OpStore %114 %113
%115 = OpLoad %v3float %21
%116 = OpLoad %v3float %22
%117 = OpAccessChain %_ptr_Function_float %99 %uint_0
%118 = OpLoad %float %117
%119 = OpVectorTimesScalar %v3float %116 %118
%120 = OpFAdd %v3float %115 %119
OpStore %23 %120
OpStore %122 %int_0
OpBranch %124
%124 = OpLabel
OpLoopMerge %126 %127 None
OpBranch %128
%128 = OpLabel
%130 = OpLoad %int %122
%131 = OpBitcast %uint %130
%133 = OpULessThan %bool %131 %uint_50
OpSelectionMerge %135 None
OpBranchConditional %133 %134 %135
%134 = OpLabel
%136 = OpAccessChain %_ptr_Function_float %99 %uint_1
%137 = OpLoad %float %136
%138 = OpFOrdGreaterThan %bool %137 %float_9_99999975en05
OpBranch %135
%135 = OpLabel
%139 = OpPhi %bool %133 %128 %138 %134
OpSelectionMerge %141 None
OpBranchConditional %139 %140 %141
%140 = OpLabel
%142 = OpAccessChain %_ptr_Function_float %99 %uint_0
%143 = OpLoad %float %142
%144 = OpLoad %float %27
%145 = OpFOrdLessThan %bool %143 %144
OpBranch %141
%141 = OpLabel
%146 = OpPhi %bool %139 %135 %145 %140
OpBranchConditional %146 %125 %126
%125 = OpLabel
%148 = OpLoad %v3float %23
OpStore %147 %148
%149 = OpFunctionCall %float %11 %147
%150 = OpFMul %float %149 %float_0_899999976
%151 = OpAccessChain %_ptr_Function_float %99 %uint_1
OpStore %151 %150
%152 = OpAccessChain %_ptr_Function_float %99 %uint_1
%153 = OpLoad %float %152
%154 = OpAccessChain %_ptr_Function_float %99 %uint_0
%155 = OpLoad %float %154
%156 = OpFAdd %float %155 %153
%157 = OpAccessChain %_ptr_Function_float %99 %uint_0
OpStore %157 %156
%158 = OpLoad %v3float %21
%159 = OpLoad %v3float %22
%160 = OpAccessChain %_ptr_Function_float %99 %uint_0
%161 = OpLoad %float %160
%162 = OpVectorTimesScalar %v3float %159 %161
%163 = OpFAdd %v3float %158 %162
OpStore %23 %163
OpBranch %127
%127 = OpLabel
%164 = OpLoad %int %122
%165 = OpIAdd %int %164 %int_1
OpStore %122 %165
OpBranch %124
%126 = OpLabel
%166 = OpLoad %v2float %99
OpReturnValue %166
OpFunctionEnd